Ask Question
23 July, 14:18

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.

+3
Answers (1)
  1. 23 July, 14:42
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers