I am new to python and have been working through a handful of activities. Currently I am working with Conditions. I created a dictionary of months and I am using an if/then condition to check if user input is in the dictionary. If the User input is not in the dictionary the output should say 'Bad Month' My code is as follows:
months = {1: 'January',
2: 'February',
3: 'March',
4: 'April',
5: 'May',
6: 'June',
7: 'July',
8: 'August',
9: 'September',
10: 'October',
11: 'November',
12: 'December'}
choice = input
choice = input('Enter an integer value for a month:')
result = choice
if int(choice) in months:
print('months')
else:
print('Bad month')
When any integer above 12 is entered the output is 'Bad Month' but when I enter a number from 1-12 the output is just months? I've tried a number of print statements but none that I have tried work. I'm stuck.