Question

write a program that takes a date as input and outputs the date's season. the input...

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

3 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

Solution

Screenshot

1 mm = input(Enter the name of the Month \n) 2 dd = int(input(Enter the day\n)) 3. if mm in (December, January, Febr

Code

mm = input("Enter the name of the Month\n")
dd = int(input("Enter the day\n"))
if mm in ('December', 'January', 'February', 'March'):
if (mm == 'March') and (dd > 19):
print('Spring')
else:
print('Winter')
elif mm in ('March', 'April', 'May', 'June'):
if (mm == 'June') and (dd > 20):
print('Summer')
else:
print('Spring')
elif mm in ('June', 'July', 'August', 'September'):
if (mm == 'September') and (dd > 21):
print('autumn')
else:
print('summer')

Output

Enter the name of the Month June Enter the day 20 Spring

---

Please follow the same indent provided in the screenshot

all the best

Add a comment
Know the answer?
Add Answer to:
write a program that takes a date as input and outputs the date's season. the input...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Write a program that takes a date as input and outputs the date's season. The input...

    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:...

  • Please show output in python Write a program that takes a date as input and outputs...

    Please show output in 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. 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...

  • Write a basic ARM program that takes a string as input, then outputs a string that...

    Write a basic ARM program that takes a string as input, then outputs a string that replaces all the vowels in the input string with 'x'. Vowels: a, A, e, E, i, I, o, O, u, U. **I am using DS-5 Eclipse Community Workspace with ARM assembly language.** The program should give the following input prompt: "Input a string: " Then, the program should output the string with the vowel(s) replaced with x. The program should terminate upon printing the...

  • Write a program that takes in a line of text as input, and outputs that line of text in reverse.

    Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Quit", "quit", or "q" for the line of text.Ex: If the input is:Hello there Hey quitthen the output is:ereht olleH yeHThere is a mistake in my code I can not find. my output is : ereht olleH ereht olleHyeHHow can I fix this?I saw some people use void or the function reverse but we didnt...

  • Using Java write a program that takes a string input from the user and then outputs...

    Using Java write a program that takes a string input from the user and then outputs the first character, then the first two, then the first three, etc until it prints the entire word.

  • Write a program that takes in a line of text as input, and outputs that line...

    Write a program that takes in a line of text as input, and outputs that line of text in reverse. You may assume that each line of text will not exceed 50 characters. The program repeats, ending when the user enters "Quit", "quit", or "q" for the line of text. Ex: If the input is: Hello there Hey quit then the output is: ereht olleH уен Hint: Use the fgets function to read a string with spaces from the user...

  • Write a program that takes in a line of text as input, and outputs that line of text in reverse.

     4.24 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Quit", "quit", or 'q" for the line of text. Ex: If the input is: Hello there Hey quit the output is: ereht ollel yeH

  • Python question: Write a program that takes in a positive integer as input, and outputs a...

    Python question: Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x modulo 2 (remainder is either 0 or 1) Assign x with x divided by 2

  • 4. Write a C++ program Write a program that takes as input five numbers and outputs...

    4. Write a C++ program Write a program that takes as input five numbers and outputs the mean (average) and standard deviation of the numbers. If the numbers are xi, Xa, x3, Xa, and xs, then the mean is x = (Xi + X2 + X3+ X4 + Xs)/5 and the standard deviation is: Your program must contain at least the following functions: a function that calculates and returns the mean and a function that calculates the standard deviation. 30...

  • 4.14 LAB: Convert to binary Write a program that takes in a positive integer as input,...

    4.14 LAB: Convert to binary Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2 Note: The above algorithm outputs the 0's and 1's in reverse order. Ex: If the input is: 6 the output is:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT