Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Python for Everybody 3.1 assignment
#11
I will try
Quote
#12
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)
ramadan2099 likes this post
Quote
#13
(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
İmage
Quote
#14
ramadan2099: it sounds like that's a different question, please start a new thread. Also, as I've said more than once, stop posting screenshots, start using code tags, start providing errors (are you getting a syntax error? it looks like it).
Feel like you're not getting the answers you want? Checkout the help/rules for things like what to include/not include in a post, how to use code tags, how to ask smart questions, and more.

Pro-tip - there's an inverse correlation between the number of lines of code posted and my enthusiasm for helping with a question :)
Quote
#15
(Jan-07-2019, 06:14 PM)micseydel Wrote: ramadan2099: it sounds like that's a different question, please start a new thread. Also, as I've said more than once, stop posting screenshots, start using code tags, start providing errors (are you getting a syntax error? it looks like it).

I am sorry
thanks
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  [split] Python for Everybody 5.2 assignment jonchanzw 4 825 7 hours ago
Last Post: perfringo
  Python Assignment 5.2 amos76823 3 1,376 Jan-17-2019, 07:34 AM
Last Post: perfringo
  Python for Everybody 3.3 assignment ramadan2099 5 1,559 Jan-09-2019, 09:10 PM
Last Post: ramadan2099
  [split] Python for Everybody 5.2 assignment ramadan2099 2 937 Jan-05-2019, 12:54 PM
Last Post: ramadan2099
  Python for Everybody 5.2 assignment baba04201 7 24,956 May-31-2018, 04:22 PM
Last Post: zaid03

Forum Jump:


Users browsing this thread: 1 Guest(s)