Good evening,
I am new to this website. And I am also new to Python. Actually I am currently in a Python class at school. I am having some difficulty with this Payroll Program. I was wondering if anyone could help. Here is my code:
def hours():
hours = input("How many hours did they work?: ")
return hours
def payrate():
payrate = input("How much is their payrate?: ")
return payrate
def calchours(pr, h):
if h > 40:
rh = 40
oh = h - 40
if h > 60:
print "Can't exceed 60 hours in a week!"
if h <= 0:
print "Can't work less than 1 hour a week!"
else:
rh = h
oh = 0
def main():
hrs = hours()
pyr = payrate()
calchours (pyr, hrs)
main()
What I am looking for is trying to get the message that pops up if someone works less than 1 hour a week. I have the greater than 60 hours working, but I can't get the less than 1 hour working. This is just the start of the program. I also am trying to get this to loop until anyone types DONE. Any help would be grateful.
(P.S. I would like to thank Vegaseat for his prior code).
(P.S.S. I know I have the tabbing correct. I just don't know how to paste it like actual code).