Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Created on Tue Mar 26 12:43:54 2013
- Exercise 4.6 Compute Pay
- @author: casa
- """
- def computepay(h,r):
- try :
- if h <= 40 :
- p = h*r
- else :
- p = 40*r + (h-40)*1.5*r
- except :
- print "Hours and rate are floats"
- return p
- hours = raw_input("Enter hours: ")
- rate = raw_input("Enter rate: ")
- pay = computepay(float(hours),float(rate))
- print "Pay: ", pay
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement