I am new to Python and I was trying to solve this exercise, but keep getting 'None' output. The question asked for a program in which the input is hours and rate and the output is the gross pay, including overtime if it is more than 40 hours. Anyway, this is the code (I am using Python 3.5.1):
def compute_pay (h,r):
if h <= 40:
pay = h*r
return
elif h>40:
pay = (((h-40)*1.5)*r+(40*r))
return
hours = input ("Enter hours:")
rate= input ("Enter rate")
x = float (hours)
y = float (rate)
p = compute_pay (x,y)
print (p)