I know it is something stupid but I cannot figure out why it does not work. Please help.
def main():
yourAge=getAge() #get subject's age
yourWeight=getWeight() #get subject's weight
yourBirthMonth=getMonth() #get subject's birth month
correctAnswers(getAge, getWeight, getMonth)
def getAge():
yourAge=input('Enter your age. ')
return yourAge
def getWeight():
yourWeight=input('Enter your weight.')
return yourWeight
def getMonth():
yourBirthMonth=input('Enter your birth month. ')
return yourBirthMonth
def correctAnswers(getAge, getWeight, getMonth):
if getAge <= 25:
print'Congratulations, age is less than 25.'
if getWeight >= 128:
print'Congratulations, weight is more than 128.'
if getMonth == 'April':
print'Congratulations, month is April.'
main()
The traceback:
Traceback (most recent call last):
File "C:/Users/Beth/Documents/jeff/prog/lab 03/lab 3-5.py", line 35, in <module>
main()
File "C:/Users/Beth/Documents/jeff/prog/lab 03/lab 3-5.py", line 10, in main
yourBirthMonth=getMonth()#get subject's birth month
File "C:/Users/Beth/Documents/jeff/prog/lab 03/lab 3-5.py", line 22, in getMonth
yourBirthMonth=input('Enter your birth month. ')
File "<string>", line 1, in <module>
NameError: name 'April' is not defined