0

I am writing a program for python and need to create a loop that appends pay, hours, and wages to one list called lstEmp,and be able to exit the loop once you type in DONE. I am stuck please help.

def Input():
    try:
        name=raw_input("Enter your first and last name: ")
        titlename=name.title()
    except:
        return name


def Hours():
    try:
        wHours=int(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 wHours
    

def Pay():
    try:
        pRate=int(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 pRate

def calc():
    
    


########################## MAINLINE CODE ###################################
    lstEmp=[]
name=""
empDone=""
while not empDone:
    Names=Input()
    WorkHours=Hours()
    Wages=Pay()
    empDOne=raw_input("Please type DONE when you are finished with employees' information: ")
    empDone.upper() == "DONE"
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by pyTony
0

Value of name, Names, Workhours, Wages. EmpDOne and result of last line is not used. Capitalized name is supposed to mean object value by convention.

Edited by pyTony: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.