Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try: # check if they are numbers or not
- # read the hours and convert them to number
- hours = raw_input("How many hours are you working?")
- hours = float(hours)
- # read the rate and covert it to number
- rate = raw_input("Enter the rate: ")
- rate = float(rate)
- # check to see if the numbers are not negative
- if rate < 0:
- print "The rate can not be negative."
- else:
- if hours < 0:
- print "The hours can not be negative"
- else:
- if hours > 40:
- print 40 * rate + (hours - 40) * (rate * 1.5)
- else:
- print rate * hours
- except:
- print "Enter numbers the next time, duude!"
Advertisement
Add Comment
Please, Sign In to add comment