Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def GetInfo():
- lstNames = []
- lstHours = []
- lstRate = []
- blnDone = False
- while blnDone == False:
- strName = raw_input("nEnter employee full name: ")
- if len(strName) == 0: #did the user press enter?
- print "Invalid entry. Please try again.n"
- strName = raw_input("Enter a your full name: ")
- else:
- lstNames.append(strName.title())
- strHours = raw_input("Enter employee hours worked (between 1-60): ")
- if int(strHours) < 1 or int(strHours) > 60:
- print "Invalid entry. Please try again.n"
- strHours = raw_input("Enter your hours worked (between 1-60): ")
- else:
- lstHours.append(int(strHours))
- strRate = raw_input("Enter employee hourly wage (between 6.00-20.00: ")
- if float(strRate) < 6.00 or float(strRate) > 20.00:
- print "Invalid entry. Please try again.n"
- strRate = raw_input("Enter your hourly wage (between 6.00-20.00: ")
- else:
- lstRate.append(float(strRate))
- strDone = raw_input("Are you done entering employee information? (yes/no): ")
- if strDone.lower() == "yes":
- blnDone = True
- elif strDone.lower()== "no":
- blnDone = False
- elif strDone.lower() != "yes" or strDone != "no":
- print "Invalid entry. Please try again.n"
- strDone = raw_input("Are you done entering employee information? (yes/no): ")
- return strName, strHours, strRate, lstNames, lstHours, lstRate
- def payFunc():
- info = getInfo()
- lstHours = info[3]
- lstRate = info[5]
- if lstHours >40:
- pay = (40*lstRate)+((lstHours-40)*(1.5*lstRate))
- elif lstHours =<40:
- pay = (lstRate*lstHours)
- return(pay)
- print(payFunc)
Add Comment
Please, Sign In to add comment