Programmes Python
Programmes Python
Programme 1 :
xh = input('Enter Hours ')
xr = input('Enter Rate ')
try :
h = float(xh)
r = float(xr)
except :
print('Put a numeric number')
quit()
def computepay(h,r) :
if h > 40 :
p = (40*r) + ((h%40)*(1.5*r))
return print('',p)
else :
p = h*r
return print('',p)
computepay (h,r)
Programme 2 :
xh = input('Enter Hours ')
xr = input('Enter Rate ')
try :
h = float(xh)
r = float(xr)
except :
print('Put a numeric number')
quit()
def computepay(h, r) :
if h > 40 :
calcul = (40*r) + ((h%40)*(1.5*r))
return calcul
else :
calcul = h*r
return calcul
p= computepay(h, r)
print(p)