2021年1月28日星期四

Multiplying floats (Python 3.7)

This is probably a really easy question but it's 2am and my brain is fried trying to figure out why they won't multiply together:

Prate2 = float(input("Please input the hourly rate of the plumber you would like to calculate: \n"))  Pfee2 = float(input("Please input the callout fee of the plumber you would like to calculate: \n"))  multiply = float(amountHours * Prate2)  total = (multiply) + (Pfee2)  print("The total cost of service:" ,(multiply) , "With a callout fee of",(Pfee2) , "to give a total of:", total)  

It gives me an error message of "TypeError: can't multiply sequence by non-int of type 'float'"

Any help would be greatly appreciated, thanks!

https://stackoverflow.com/questions/65947796/multiplying-floats-python-3-7 January 29, 2021 at 09:59AM

没有评论:

发表评论