Ask Question
25 September, 14:05

python Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an int to represent the day.

+4
Answers (1)
  1. 25 September, 15:38
    0
    month = input ("Input the month (e. g. January, February etc.) : ")

    day = int (input ("Input the day: "))

    if month in ('January', 'February', 'March'):

    season = 'winter'

    elif month in ('April', 'May', 'June'):

    season = 'spring'

    elif month in ('July', 'August', 'September'):

    season = 'summer'

    else:

    season = 'autumn'

    if (month = = 'March') and (day > 19):

    season = 'spring'

    elif (month = = 'June') and (day > 20):

    season = 'summer'

    elif (month = = 'September') and (day > 21):

    season = 'autumn'

    elif (month = = 'December') and (day > 20):

    season = 'winter'

    print ("Season is", season)
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “python Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an int to ...” in 📙 Engineering if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers