Computers and Technology
Computers and Technology, 27.09.2021 19:50, amoore51

I am working on 4.17 LAB Seasons for 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.

April
11
the output is:

Spring
In addition, check if the string and int are valid (an actual month and day).

Ex: If the input is:

Blue
65
the output is:

Invalid
My code is not shaping up too well. When I do this its either Invalid or Summer:
input_month = input()
input_day = int(input())

if input_month == 'March':
if not(1<=input_day<=31):
print ("Invalid")
elif input_day<=19:
print("Winter")
else:
print ("Spring")
if input_month == 'April' :
if not(1<=input_day<=30):
print("Invalid")
elif input_day <=30:
else:
print("Spring")
if input_month == "May":
I just need to be pointed in the right direction. Thanks for your help!

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:00, bbysl15
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
image
Computers and Technology, 22.06.2019 23:50, Crull5999
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
image
Computers and Technology, 23.06.2019 02:30, jalaholmes2027
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
image
Computers and Technology, 24.06.2019 01:00, kkruvc
Mastercard managers are motivated to increase (1) the number of individuals who have and use a mastercard credit card, (2) the number of banks and other clents who issue mastercards to customers and/or employees, and (3) the number of locations that accept mastercard payments. discuss how mastercard could use its data warehouse to it expand each of these customer bases.
Answers: 3
Do you know the correct answer?
I am working on 4.17 LAB Seasons for python Write a program that takes a date as input and outputs...

Questions in other subjects:

Konu
Biology, 27.04.2021 14:40