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
What are the different types database of end users? Discuss the main activi-ties of each
disa [49]

Answer:

following types of databases available in the market −

Centralised database.

Distributed database.

Personal database.

End-user database.

Commercial database.

NoSQL database.

Operational database.

Relational database.

Cloud database.

Object-oriented database.

Graph database

8 0
2 years ago
Read 2 more answers
Match the following: B. Static libraries A. Dynamic Link Libraries (DLL) - Using static libraries - Making some changes to DLL A
TiliK225 [7]

Answer:  hello your question is poorly written and I have been able to properly arrange them with the correct matching

answer

Static libraries :  C

Dynamic link libraries:  A

Using static libraries:  B

Making some changes to DLL:   D

Explanation:

Matching each term with its meaning

<u>Static Libraries </u> : Are attached to the application at the compile time using the Linker ( C )

<u>Dynamic link libraries</u> ( DLL ) : Is Loaded at runtime as applications need them ( A )

<u>Using static Libraries </u>: Makes your program files larger compared to using DLL ( B )

<u>Making some changes to DLL </u>: Does not require application using them to recompile ( D )

8 0
3 years ago
Is discord down right now?
Eva8 [605]

Answer:

yes it is

Explanation:

To do this, visit discord.com and login to the web version. Once logged in using the right credentials launch the app on your PC, discord should work properly now. Ensure the system is up to date. As a last resort, uninstall and reinstall the app again.

3 0
3 years ago
Differences between mechanical and optical mouse <br>Plz help me
lutik1710 [3]
Mechanical mouse has a ball that turns rollers inside. If friction is lost between the ball and the mousing surface, or between the ball and the rollers, the mouse fails to work. In order to assure good contact with the mousing surface, the ball must be fairly heavy. When you change directions with the mouse, you must make the ball change rolling directions--an action that inertia likes to prevent.

An optical mouse makes use of an LED and some optics to detect surface texture and the changes in it as the mouse is moved. There are no moving parts
7 0
3 years ago
Increasing your margins will increase the amount of space you have to type text on your document. Please select the best answer
Ksenya-84 [330]

It is false because if the margins, the space on the side of a paper, gets bigger, that means there is more emptiness and less space for text.

4 0
3 years ago
Other questions:
  • Which magazine can help public determine best technology to buy
    12·1 answer
  • To create a formula, click the cell where you want to add the formula and press the _____ key.
    10·2 answers
  • The class attribute a. can be applied to only one element in an HTML document b. determines the copy that will be displayed when
    5·1 answer
  • NEED HELP NOW 25 POINTS WILL MARK BRAINLIEST!!!!!!!
    8·1 answer
  • Fedora operating system
    9·1 answer
  • A user calls you and says that when they try to connect to the internal website, they are prompted for authentication. The user
    14·1 answer
  • In most programming languages, the compiler carries a preprocessing step to determine if certain statements will compile. For in
    7·1 answer
  • Where can i watch bnha movie 2 online for free, with no sign up or pay?
    6·2 answers
  • NEED HELP
    9·1 answer
  • What is the digital revolution and how did it change society?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!