Ask Question
26 July, 21:59

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. 26 July, 22:48
    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 you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers