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
DES: Group of answer choices A) is a commonly used symmetric encryption B) algorithm that was developed in the mid-C) 1970s was
OLEGan [10]

DES is a commonly used symmetric encryption

A) is a commonly used symmetric encryption

<u>Explanation:</u>

DES stands for Data Encryption Standard. It is a symmetric key algorithm and is used for encrypting electronic data. It was developed in 1975. DES is one of the oldest encryption standards to be used in the industry.

The algorithm takes 16 rounds of permutations in order to encrypt data. But now, with the advent of technology, as new algorithms have been designed and put in use, DES is less preferable.

In the process of key generation, some keys generated sometimes turn out to be weak and hence are prone to attacks. If not for the weak keys generation, DES works perfectly fine and is an effective algorithm to encrypt data.

6 0
3 years ago
Rita wants to know the size of each image in a folder. Which view will help her find this information quickly?
vaieri [72.5K]
The correct answer would be details.

8 0
3 years ago
What is the difference between an electronic notebook and electronic flash cards?
Ivenika [448]

Answer:

A) Electronic notebooks store images, videos, notes, and voice recordings in one area, while electronic flash cards are study tools with information written on both sides.

Explanation:

Just took the test

Edge 2020

7 0
3 years ago
An application programming interface (API) is: Group of answer choices the code the application software needs in order to inter
WITCHER [35]

Answer:

The code the application software needs in order to interact with the CPU

Explanation:

7 0
3 years ago
Create a horizontal line across middle of the entire form. To code this the ____ values are the same.
fredd [130]

To make a horizontal line in mathematics you require some sort of constant function. Where no matter the input x the output y will always equal to a certain number n.

For eg. consider n = 2. Hence the graph of line has an equation of y = n making it always intercept in (x, n). As x increases the y is the same therefore the horizontal infinite line emerges.

So to plot or code this kind of program you need to have the same values of y therefore y is a constant function.

Hope this helps.

r3t40

5 0
3 years ago
Read 2 more answers
Other questions:
  • Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn
    10·1 answer
  • Typohunting is registering a domain name that is similar to a trademark or domain name but that is slightly misspelled in hopes
    5·1 answer
  • A design tool helps you plan, evaluate, and explain your ideas to create a product. Some examples of design tools are outlines,
    10·2 answers
  • When you access the programs and documents on a computer by what way of icons is said to be employing
    6·1 answer
  • Citing the recent increase in earnings by several computer companies, economists feel that a cycle has begun in which personal c
    13·1 answer
  • To achieve asymptotically optimal performance, a skip list must use promotion probability . true or false and
    14·1 answer
  • "What is the capital of Belarus?" is an example of what type of search query
    10·2 answers
  • Define a class called Counter. An object of this class is used to count things so it records a count that is a non-negative whol
    12·1 answer
  • Which of the following items can you locate in a document using the navigation pane? Choose the answer.
    10·1 answer
  • !!! PLEASE HELP ASAP REALLY NEED IT !!!
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!