Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python for Everybody 3.1 assignment
#1
Hi
I need help please
I tried and did not succeed
İmage
Quote
#2
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.
Quote
#3
I did not understand what was required
So I asked for help
Quote
#4
use print to print the pay result
Quote
#5
My friend how I will reach output 498.75
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")
micseydel wrote Jan-05-2019, 04:09 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Quote
#6
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.
Quote
#7
I am sorry my friend
I am a beginner
I do not understand
Help me write the code

İmage



I have tested the code on Pycharm
I do not know what to put in order to get the output 498.75
Quote
#8
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)

ramadan2099 likes this post
Quote
#9
(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
Quote
#10
Looks like you're supposed to get the hourly rate as well, not hard-code it.
ramadan2099 likes this post
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Python Assignment 5.2 amos76823 3 115 Jan-17-2019, 07:34 AM
Last Post: perfringo
  Python for Everybody 3.3 assignment ramadan2099 5 203 Jan-09-2019, 09:10 PM
Last Post: ramadan2099
  Help for my assignment - Object Oriented Programming denizkb 5 152 Jan-05-2019, 06:43 PM
Last Post: stullis
  [split] Python for Everybody 5.2 assignment ramadan2099 2 163 Jan-05-2019, 12:54 PM
Last Post: ramadan2099
  help with assignment 3 Mof44 5 207 Dec-14-2018, 01:33 PM
Last Post: Mof44
  help with assignment 2 Mof44 4 258 Nov-29-2018, 08:26 PM
Last Post: Mof44
  help with assignment Mof44 9 402 Nov-18-2018, 11:58 PM
Last Post: Larz60+
  Need help on assignment sstonne 1 273 Nov-01-2018, 02:48 PM
Last Post: sstonne
  Dictionary based assignment: Need help RoyceJ 6 531 Aug-29-2018, 05:30 AM
Last Post: perfringo
  Trouble with "Weather Program" Assignment sarah_mb_sues 5 856 Aug-10-2018, 02:29 AM
Last Post: ichabod801

Forum Jump:


Users browsing this thread: 1 Guest(s)