Good afternoon,
I have posted a similar question before. I am a Python Newbie. But, I really need some code help here. I am writing a payroll program. Here is my code:
employee=[]
eName="Employee"
pRate="Payrate"
hWork="Weekly Hours"
while (eName, pRate, hWork)>0:
eName=raw_input("\nEnter the employees' first and last name. ")
pRate=int (raw_input("What is their hourly wages? " ))
if pRate < 6 or pRate > 20:
print ("Employee has to make at least $6 and no more than $20!")
hWork=int (raw_input("How many hours did they work this week? "))
if hWork < 1 or hWork > 60:
print ("Employee has to work at least 1 hour and no more than 60 hours!")
Now here is my question. I am trying to get the error messages to pop up right after they make and error in the hours worked of wages. I want them to ask the same question again instead of going to the next one when the user makes and error. My error messages show up. But it is going to the next input question instead of repeating the question. How can I make it repeat the same question? And this is an infinite loop. I am totally drawing a blank on how to end the loop. The loop is suppose to end when the user types in done.