Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Exercise 4.6
- def computepay(hrs, rate):
- if hrs >= 40:
- pay = (40 * rate) + ((hrs - 40) * rate * 1.5)
- else:
- pay = (hrs * rate)
- return pay
- try:
- hrs = float(raw_input('How many hours did you work this week? \n'))
- rate = float(raw_input('What is your rate? \n'))
- except:
- print 'Please enter a number. \n'
- quit()
- print 'Pay: \n', computepay(hrs, rate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement