Jan-07-2019, 02:22 PM
(This post was last modified: Jan-07-2019, 02:28 PM by ramadan2099.)
(Jan-07-2019, 12:12 PM)Mr_W Wrote: Yes sorry micseydel is right, I overread that part. rate should be an input as well
The correct code is:
hours = float(input("Enter hours: ")) rate = float(input("Enter rate per hour: ")) ratePlus = rate * 1.5 if hours > 40: pay = 40 * rate + (hours - 40) * ratePlus else: pay = hours * rate print (pay)
thank you my friend
It worked
(Jan-07-2019, 02:22 PM)ramadan2099 Wrote:(Jan-07-2019, 12:12 PM)Mr_W Wrote: Yes sorry micseydel is right, I overread that part. rate should be an input as well
The correct code is:
hours = float(input("Enter hours: ")) rate = float(input("Enter rate per hour: ")) ratePlus = rate * 1.5 if hours > 40: pay = 40 * rate + (hours - 40) * ratePlus else: pay = hours * rate print (pay)
thank you my friend
It worked
whats wrong in my code here
[Image: 284945816.png]