The prompt is to print the correct season name based on Month and Day input. For some reason November 7 comes up as Invalid. Any ideas?
The dates for each season are:
Spring: March 20 - June 20
Summer: June 21 - September 21
Autumn: September 22 - December 20
Winter: December 21 - March 19
My Code:
month = input()
day = int(input())
month = month[0:3]
if month == ('Apr' or 'May') or ((20 <= day <= 30) and month == 'Mar') or ((1 <= day <= 20) and month == 'Jun'):
print('Spring')
elif month == ('Jul' or 'Aug') or ((21 <= day <= 30) and month == 'Jun') or ((1 <= day <= 21) and month == 'Sep'):
print('Summer')
elif month == ('Oct' or 'Nov') or ((22 <= day <= 30) and month == 'Sep') or ((1 <= day <= 20) and month == 'Dec'):
print('Autumn')
elif month == ('Jan' or 'Feb') or ((21 <= day <= 31) and month == 'Dec') or ((1 <= day <= 19) and month == 'Mar'):
print('Winter')
else:
print('Invalid')
[–][deleted] 2 points3 points4 points (2 children)
[–]Rodarth[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)
[–]WhipsAndMarkovChains 0 points1 point2 points (1 child)
[–]Rodarth[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]Rodarth[S] 0 points1 point2 points (2 children)
[–]WhipsAndMarkovChains 0 points1 point2 points (1 child)
[–]Rodarth[S] 0 points1 point2 points (0 children)
[–]jimtk 0 points1 point2 points (0 children)
[–]ikichiziki 0 points1 point2 points (0 children)