Jan-04-2019, 11:58 PM
Pages: 1 2
Jan-05-2019, 12:14 AM
You never print the pay. Give that a try.
Also - please don't post a screenshot of code again, post using code tags - https://python-forum.io/misc.php?action=help&hid=25
Generally, we strongly prefer text to screenshots.
Also - please don't post a screenshot of code again, post using code tags - https://python-forum.io/misc.php?action=help&hid=25
Generally, we strongly prefer text to screenshots.
Jan-05-2019, 10:39 AM
I did not understand what was required
So I asked for help
So I asked for help
Jan-05-2019, 11:09 AM
use print to print the pay result
Jan-05-2019, 11:31 AM
My friend how I will reach output 498.75
What is the calculation of each asset to this output?
What is the calculation of each asset to this output?
inp = input ("Enter Hours: ") hours = float(inp) inp = input("Enter Rate: ") rate = float(inp) if hours <=40 : pay = rate * hours else : pay = rate * 40 + ( rate * 1.5 * (hors - 40) ) print("pay")
Jan-05-2019, 04:13 PM
As I said before, use code tags when posting code. See the link I provided before if you're unsure how.
Your calculation is correct, but you have two other bugs in your program. The first is that you misspelled hours on line 8. Have you tested your code? I highly recommend doing so before making posts online about it. The second bug is that on your last line, you have quotes around "pay" when you should not.
Your calculation is correct, but you have two other bugs in your program. The first is that you misspelled hours on line 8. Have you tested your code? I highly recommend doing so before making posts online about it. The second bug is that on your last line, you have quotes around "pay" when you should not.
Jan-05-2019, 06:59 PM
I am sorry my friend
I am a beginner
I do not understand
Help me write the code
[Image: 322129304.png]
I have tested the code on Pycharm
I do not know what to put in order to get the output 498.75
I am a beginner
I do not understand
Help me write the code
[Image: 322129304.png]
I have tested the code on Pycharm
I do not know what to put in order to get the output 498.75
Jan-06-2019, 06:24 PM
This should do the trick. Input 45 gives 498.75.
hours = float(input("Enter hours: ")) rate = 10.5 ratePlus = 10.5 * 1.5 if hours > 40: pay = 40 * rate + (hours - 40) * ratePlus else: pay = hours * rate print (pay)
Jan-06-2019, 09:51 PM
(Jan-06-2019, 06:24 PM)Mr_W Wrote: [ -> ]This should do the trick. Input 45 gives 498.75.
hours = float(input("Enter hours: ")) rate = 10.5 ratePlus = 10.5 * 1.5 if hours > 40: pay = 40 * rate + (hours - 40) * ratePlus else: pay = hours * rate print (pay)
http://www9.0zz0.com/2019/01/07/00/601889633.png
look my friend
Jan-06-2019, 11:12 PM
Looks like you're supposed to get the hourly rate as well, not hard-code it.
Pages: 1 2