I am a python newbie and have written a short program. The first part works but the if statement part has a traceback/syntax? problem. Advice?
hours = input("How many hours did you work this week?")
wage = input("How much do you make each hour?")
weeklySalary = hours * wage
print "You made", weeklySalary, "dollars this week."
daily = str(input("Would you like to know your daily average this week?"))
if daily in ['Yes' , 'yes' , 'Y' , 'y']:
print "You averaged", (weeklySalary / 7), "dollars per day."
else:
print "Maybe next week..."
Here is the error:
How many hours did you work this week?10
How much do you make each hour?10
You made 100 dollars this week.
Would you like to know your daily average this week?yes
Traceback (most recent call last):
File "/Users/jake/Desktop/Python_U_M/weekly_salary.py", line 5, in <module>
daily = str(input("Would you like to know your daily average this week?"))
File "<string>", line 1, in <module>
NameError: name 'yes' is not defined