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
alexira [117]
3 years ago
9

In python

Computers and Technology
1 answer:
AnnZ [28]3 years ago
7 0

Answer:

The program in Python is as follows:

mnths = ["january","february","march","april","may","june","july","august","september","october","november","december"]

days = int(input("Day: "))

month = input("Month: ")

if not(month.lower() in mnths):

   print("Invalid")

else:

   month_index = mnths.index(month.lower())

   if month_index == 0:

       if days<1 or days>31:            print("Invalid")

       else:            print("Winter")

   elif month_index == 1:

       if days<1 or days>28:            print("Invalid")

       else:            print("Winter")

   elif month_index == 2:

       if days<1 or days>31:            print("Invalid")

       elif days<= 19:            print("Winter")

       else:            print("Spring")

   elif month_index == 3:

       if days<1 or days>30:            print("Invalid")

       else:            print("Spring")

   elif month_index == 4:

       if days<1 or days>31:            print("Invalid")

       else:            print("Spring")

   elif month_index == 5:

       if days<1 or days>30:            print("Invalid")

       elif days<= 20:            print("Spring")

       else:            print("Summer")

   elif month_index == 6:

       if days<1 or days>31:            print("Invalid")

       else:            print("Summer")

   elif month_index == 7:

       if days<1 or days>31:            print("Invalid")

       else:            print("Summer")

   elif month_index == 8:

       if days<1 or days>31:            print("Invalid")

       elif days<= 21:            print("Summer")

       else:            print("Autumn")

   elif month_index == 9:

       if days<1 or days>31:            print("Invalid")

       else:            print("Autumn")

   elif month_index == 10:

       if days<1 or days>30:            print("Invalid")

       else:            print("Autumn")

   elif month_index == 11:

       if days<1 or days>31:            print("Invalid")

       elif days<21:            print("Autumn")

       else:            print("Winter")

Explanation:

<em>See attachment for complete source file, where comments are used to explain difficult lines</em>

Download txt
You might be interested in
1. What is the central idea of the section "Service Record." Use two text details to
Vladimir [108]

Answer:

Service record is the record that is used to track the record of service of the employ in an organization.

Explanation:

The idea behind the service record is to maintain the whole detail of record of the person during his employment including, personnel information,  record related to his promotions and posting, salary record etc.

8 0
4 years ago
Which of the following is most likely to include technical vocabulary?
Step2247 [10]
<span>C. a scientific article</span>
6 0
3 years ago
Choose all statements that identify the benefits of programming design.
Lubov Fominskaja [6]

Answer:

yes

Explanation:

it provides a design approach to a specific type of problem

4 0
3 years ago
Read 2 more answers
Using Sequential Search on an array of size n, the search key is definitely present in the array. The probability of matching th
MissTica

Answer:

(11n-5) / 12 is correct answer.

Explanation:

The Probability that key will match to nth term = 1/2

The Probability that key will match to n-1th term = 1/3

As all other probabilities are equal

The Total Probability that key matches to any of 1 to n-2 index = 1 - 1/2 - 1/3 = 1/6

The Probability that key matches to any of 1 to n-2 index = (1/6) / n-2 = (1/6)* (n-2))

Let P(i) = Probability that key matches to ith index.

The Average time complexity = 22 i=1 P(i) * i

The Average time complexity = 1/(6(n-2) * ( sum of 1 to n-2 ) + (n-1) / 3 + n/2

The Average time complexity = 1/(6(n-2) * ( n-2)*(n-1) / 2 + ( n-1) / 3 + n/2

The Average time complexity = 1/6 * (n-1)/2 + (n-1)/3 + n/2

The Average time complexity = (n-1)/12 + (n-1)/3 + n/2

The Average time complexity = (n-1 + 4 * n - 4 * 1 +6 * n)/12

The Average time complexity = 11n-5 / 12

so (11n-5) / 12 is correct answer.

7 0
3 years ago
Help?!<br> Does anyone know how to use Adobe SoundBooth?
Mandarinka [93]
Never heard of that but it probably just have the kind of use of abobe flash
7 0
3 years ago
Read 2 more answers
Other questions:
  • A(n) ________ moves over the spinning platters to retrieve data from the hard disk.
    6·1 answer
  • What should be done if a system cannot boot from the hard drive?
    14·1 answer
  • What happens when two computers have the same IP address?
    13·1 answer
  • Can someone explain what Bytes are? I would really like to know.
    5·2 answers
  • Write a SELECT statement that returns one row for each musician that has orders with these columns:
    13·1 answer
  • Write the definition of a function that evaluates three double numbers and returns true if the floor of the product of the first
    8·1 answer
  • PLEASE HELP WILL GIVE BRAINLIEST!!!’
    15·1 answer
  • 2. Which of the following is a shortcut key to Exit from any operation?
    10·2 answers
  • Chris is working with other employees on a worksheet. the other employees have made comments, but they are not visible.
    11·1 answer
  • In what medium do web applications operate?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!