I am having a problem with my code here. The error that I am receiving is on the bottom. I have to enter payroll in and calculate pay with overtime or without.
enter code here ####################### Functions ######################## def Input(): try: name=raw_input("Enter your first and last name: ") titlename=name.title() except: return Input
def Hours(): try: wHours=raw_input("Enter the hours you worked this week: ") except: if wHours < 1 or wHours > 60: print "Employees' can't work less than 1 hour or more than 60 hours." return lstEmp
def Pay(): try: pRate=raw_input("Enter your hourly wage: ") except: if pRate < 6 or pRate > 20: print "Employees' wages can't be lower than $6.00 or greater than $20.00." return pay
def calcHours(pr,h): if h <= 40: pr * h else: (h -40) *(pr *1.5) + pr * 40 return lstEmp
def end(): empDone=raw_input("Please type DONE when you are finished with employees' information: ") empDone.upper() == "DONE"
#################### MAINLINE CODElstEmp=[] Names=""
while True: Names=Input()
WorkHours=Hours()
Wages=Pay()
gPay=calcHours(WorkHours, Wages)
Done=end()
if end():
break
Traceback (most recent call last): File "J:\11-2-10.py", line 53, in gPay=calcHours(WorkHours, Wages) File "J:\11-2-10.py", line 29, in calcHours pr * h TypeError: unsupported operand type(s) for *: 'NoneType' and 'NoneType'
try/exceptdoesn't do what you think it does. You probably want to useifinstead. You also need to be consistent with your variable namesPay, pRate, and paylook like they are supposed to be the same thing - John La Rooy