1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kenny6666 [7]
1 year ago
11

Hello, I've tried everything and I cannot get this code to be fair. I need help. Can someone provide guidance so I can understan

d how to formulate the proper code for this question so I can understand how it should be set up in Python or Python #. Thanks truly. I really appreciate a response. Enjoy your day:
2.26 LAB: Seasons
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.

Ex: If the input is:

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
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
Computers and Technology
1 answer:
Liula [17]1 year ago
5 0

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 is given below:

<h3>The Program</h3>

input_month = input()

input_day = int(input())

months= ('January', 'February','March', 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , "October" , "November" , "December")

if not(input_month in months):

  print("Invalid")

elif input_month == 'March':

   if not(1<=input_day<=31):

       print ("Invalid")

   elif input_day<=19:

       print("Winter")

   else:

      print ("Spring")

elif input_month == 'April' :

   if not(1<=input_day<=30):

       print("Invalid")

   else:

      print("Spring")

elif input_month == 'May':

   if not(1<=input_day<=31):

       print("Invalid")

   else:

       print("Spring")

elif input_month == 'June':

   if not(1<=input_day<=30):

       print("Invalid")

   elif input_day<=20:

       print ("Spring")

   else:

       print("Summer")

elif input_month == 'July' or 'August':

   if not(1<=input_day<=31):

       print("Invalid")

   else:

       print("Summer")

elif input_month == 'September':

   if not(1<=input_day<=30):

       print("Invalid")

  elif input_day<=21:

       print ("Summer")

   else:

       print ("Autumn")

elif input_month == "October":

   if not(1<=input_day<=31):

      print("Invalid")

   else:

       print("Autumn")

elif input_month == "November":

   if not(1<=input_day<=30):

       print("Invalid")

   else:

       print ("Autumn")

elif input_month == "December":

   if not(1<=input_day<=31):

       print("Invalid")

   elif input_day <=20:

       print ("Autumn")

   else:

       print ("Winter")

elif input_month == 'January':

   if not(1<=input_day<=31):

       print("Invalid")

   else:

       print("Winter")

elif input_month == "February":

   if not(1<=input_day<=29):

       print("Invalid")

   else:

       print ("Winter")

Read more about programming here:

brainly.com/question/23275071

#SPJ1

You might be interested in
A __________ is the blueprint for __________ having similar attributes and behaviors. signature, objects class, parameters heade
MrRa [10]

Answer: E. class, objects

Explanation:

<em>A </em><em><u>class</u></em><em> is the blueprint for </em><em><u>objects</u></em><em> having similar attributes.</em>

As much as classifying something means to define it based on the characteristics that is has that are similar to other things in that class, so also is a class here.

A class is the blueprint or rather template for making objects that have similar attributes which means that the class therefore gives the object its various attributes and its behavior.

4 0
2 years ago
What career opportunities are available within the floral industry?
Vsevolod [243]

Answer: The floral industry has quite an array of possible occupation pathways. You can do flower production, design, publishing, marketing, home design, engineering, retailing, commercial, research, and lots more.

6 0
2 years ago
A marketing company setting up a new office in the city. Which type of contract should I sign for periodic maintenance of their
Fed [463]

Answer:

Fixed-term contract is most feasible in this scenario.

Explanation:

8 0
3 years ago
If you were programming a robot to respond to touch, the path might look something like this:
aniked [119]

Answer:

what

Explanation:

5 0
3 years ago
Read 2 more answers
PLEASE help me i dont get this at all
zepelin [54]

Answer:

dont know dont really care

Explanation:

6 0
2 years ago
Read 2 more answers
Other questions:
  • What is the opening page of a website called?
    9·2 answers
  • 1) Put the following in order from smallest to largest A) 1,500,000 bytes B) 2,000 kilobytes C) 0.01 petabytes D) 1 Terabyte E)
    8·1 answer
  • Answers please !!!!!!!!!!!!!!!!!!!!!!!!!!!
    8·1 answer
  • Owning provides _________ flexibility but can lead to _________ costs in the long-term.
    7·2 answers
  • If given the chance to own manage a business,what will be the name of the business?
    11·2 answers
  • Assume n represents the number of inputs. The possible number of states within a truth table can be calculated using which of th
    10·1 answer
  • ​Client/server computing is​ a: A. network that connects sensors to desktop computers. B. distributed computing model where clie
    12·1 answer
  • Python3
    7·1 answer
  • Please help! first one to answer correctly gets brainliest and thanked
    7·1 answer
  • HELP!!!!!!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!