Rachel M.

asked • 02/13/23

python program problem

my program imports another program I wrote. the part of the imported program I'm having a problem with is .

def get_float(prompt):

  variable = float(input(prompt))

  variable = float(varaible)

  return variable

the errors I get when I try and use this in the program it is imported into is 'could not convert string to float'

future = csc111_input.get_int(input("Enter the future value: "))

      interest = csc111_input.get_float(input("Enter the interest rate: "))

      num_periods = csc111_input.get_int(input("Enter the number of periods: "))

      pv = p1p1_engr_econ.sp_pres_worth(future, interest, num_periods)

      print(f"The present value of {future} when {num_periods} payments with {interest} rate is: "+"\033[91m"str(format(pv, '.2f')) + "\033[0m")

Rachel M.

The last bit is the function that imports the get_float
Report

02/13/23

1 Expert Answer

By:

Jason C. answered • 02/15/23

Tutor
New to Wyzant

College-level Computer Science student

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.