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
  Powerball assignment, how to get correct output of a dictionary ? msp1981 5 93 Mar-19-2019, 11:02 PM
Last Post: Yoriz
  Help with homework assignment grayarea3 1 177 Feb-20-2019, 10:10 PM
Last Post: ichabod801
  Help with assignment dxfrelince 7 300 Feb-18-2019, 09:16 PM
Last Post: dxfrelince
  Need help with a tough school assignment datson79 5 216 Feb-18-2019, 06:01 PM
Last Post: ichabod801
  Need some help with a bit of code for an assignment. JackMercer50 1 141 Feb-09-2019, 04:13 PM
Last Post: stullis
  Help with arrays assignment hyg71886 15 405 Jan-30-2019, 09:36 AM
Last Post: perfringo
  Python Assignment 5.2 amos76823 3 392 Jan-17-2019, 07:34 AM
Last Post: perfringo
  Python for Everybody 3.3 assignment ramadan2099 5 373 Jan-09-2019, 09:10 PM
Last Post: ramadan2099
  Help for my assignment - Object Oriented Programming denizkb 5 260 Jan-05-2019, 06:43 PM
Last Post: stullis
  [split] Python for Everybody 5.2 assignment ramadan2099 2 362 Jan-05-2019, 12:54 PM
Last Post: ramadan2099

Forum Jump:


Users browsing this thread: 1 Guest(s)