python - TypeError: float() argument required to be a string or a number -


I am in grade 11 computer science in my high school, and I am just starting in Python. I should do a function called computepay that will ask the user for their name, their wages, and the hours of that week and automatically calculates the total including any overtime, and there will be no wrong input Includes. I have created different functions for all inputs, but when I plug it in my computepay function it tells me:

Type error: The float () argument must be string or a number

 
def mainloop (): # This error is not to create a loop response = input ('do another calculate? [Y / n] ') Input # input ==' n '# In response: #Using input to return Give Feedback == 'y': computepay () else: print ("N") print ("wrong input.") Mainlope () def getname (): name = input ("what is your name?") #dip Input of input (input) = wage = input ("hello there! Money are you per hour?") Try the # input: float (wage) # This error is not there when creating a float: print ( "Bad input") getwage () def gethours (): hours = input ("Thank you, how many hours have you worked this week?") Try: float (hours) # make it Lue does not float, except it is: print ( "bad input") gethours () def computepay (): name = Getname () Salary = Getwage () hours = find (time) that float (h) & gt; Float (40): Newhors = Float (Hours) - Float (40) # In order to detect the amount of overtime hours, the person has done the new air = float * float (1.5) overtime pay overtimpe = float (new) * Float (Newhors) # Overtime Total Regular Payments = (Float (40) * Float (Wage)) + Overtimap # Regular and Overtime Total Preservation Print (name, ", you made $", round (regular payment, 2), "this week."): Total = float (wages) * float (hours) print (name, "you will have" Given ", round (total, 2)," this week. ") Mainloop () #creating the loop # -------------------------- --------------------------------------------------- --- Compute ()

  name = getname () wages = (When) = meet ()   

so they all have none

  d Ef getname (): return input "what is your name?") # Input of def meldage :) wage = input ("hello there! How much money do you earn per hour?") # Input return float (wages) Def gethours ): Hours = input ("Thank you, how many hours did you work this week?") Return float (hours)    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -