I'm trying to get the user to enter what shift they worked, if they enter first shift then the pay rate would be 12.30, if they enter second shift pay rate is 14, and so on.
What I have so far:
The part I need help with is the getPayRate part, I'm not sure how choose from the three work shifts.
What I have so far:
Code:
firstShift=12.30
secondShift=14.20
thirdShift=15.30
tax = .28
otMultiplier = .5
def main():
name = getName()
hrsWrkd = int(input("Enter hours worked: "))
shift = getShift()
payRate = getPayRate(shift)
display(name,shift)
def getName():
name=input("Enter employee name: ")
return name
def getShift():
shift = input("Enter shift worked: ")
return shift
def getPayRate(shift):
payRate = firstShift
if shift==firstShift:
return shift
if shift==secondShift:
return
def display(name,shift):
print("The pay rate for", name)
print("Working shift",shift,"is",payRate)
main()
Comment