Question

1) Write a Python program that prompts the user to enter the current month name and...

1) Write a Python program that prompts the user to enter the current month name and prints the season for that month. Hint: If the user enters March, the output should be "Spring"; if the user enters June, the output should be "Summer".

2 )Write a Python program using the recursive/loop structure to print out an equilateral triangle below (double spacing and one space between any two adjacent asterisks in the same row).

         *

     * * *

* * * *

For question number 1 and 2 can someone please show the problem-solving in Jupyter notebook please .

*   * *   * *

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

1) Program:

month = input("Enter month like January..December: ")

if(month=='January' or month=='February' or month=='December'):
season='Winter';
elif(month=='April' or month=='May' or month=='March'):
season='Spring';
elif(month=='July' or month=='August' or month=='June'):
season='Summer';
elif(month=='September' or month=='October' or month=='November'):
season='Autumn';
  
print("Season is:",season)

Output:

Enter month like January.. December: March Season is: Spring

Code snippet for better indentation:

month = input(Enter month like January..December: ) if(month==January or month==February or month==December): season=

2)

Program:

n=3
for i in range(1, 4):
print(' '*n, end='') #for repeat space
print('* '*(i))
n-=1

Output:

phpGtHRC1.png

Code snippet:

n=3 for i in range(1, 4):| print( *n, end=) #for repeat space print(* *(i)) n-=1

Add a comment
Know the answer?
Add Answer to:
1) Write a Python program that prompts the user to enter the current month name and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a Python program in this Jupyter Notebook. This program will allow a user to choose...

    Write a Python program in this Jupyter Notebook. This program will allow a user to choose from a menu to print various text shapes includeing rectangle, triangle, and diamond as well as a set of numbers in a pattern. This program will allow the user to select the type, the size and/or the fill character for a shape. Your program will verify user inputs such as size for certain range specifications, depending on the shapes.

  • Write a program which: - prompts the user for 2 numerical inputs - stores their two...

    Write a program which: - prompts the user for 2 numerical inputs - stores their two inputs in variables as floats - Use a while in loop to ask a user for a valid operation: (if the user's input operation isn't one of those listed above, instead print a message telling them so, and continue asking for the valid operation) - prompts the user for an arithmetic operation ( + - * / %) - stores the user's input as...

  • write a python program that prompts the user for a name of a text file, opens...

    write a python program that prompts the user for a name of a text file, opens that file for reading , and tracks the unique words in a file and counts how many times they occur in the file. Your program should output the unique words and how often they occur in alphabetical order. Negative testing for a file that does not exist and an empty file should be implemented.

  • Write a PYTHON program that allows the user to navigate the lines of text in a...

    Write a PYTHON program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the...

  • please solve using python thank you! Write a program which prompts the user to enter a...

    please solve using python thank you! Write a program which prompts the user to enter a number of rows, and prints a hollow square star pattern with 2 diagonals. Note: you can assume that the integer will always be > 1 and will be an odd number. For example: Input Result 5 Enter number of rows: 5 ***** ** ** * * * ** ** ***** 9 Enter number of rows: 9 ** ** ** * * * * *...

  • Write a Python program that prompts the user to enter their three favorite bands separate by...

    Write a Python program that prompts the user to enter their three favorite bands separate by commas, and prints their selections on three separate bands. Hint: You will need to use the string function, split. A sample run appears below (user input shown in bold): Enter your favorite bands separated by commas: The Beatles,Queen,Bruce Springsteen My favorite bands are: The Beatles Queen Bruce Springsteen

  • Answer in python please and use loop Question 2: Write a program that prompts the user...

    Answer in python please and use loop Question 2: Write a program that prompts the user to enter a sentence string. The program will either print True if the sentence contains every letter of the alphabet. If the sentence does not contain each letter, print which letters are missing. The results should not depend on capitalization. Hint: a loop may be very handy in the solution.

  • Write a python program that prompts the user for the names of two text files and...

    Write a python program that prompts the user for the names of two text files and compare the contents of the two files to see if they are the same. If they are, the scripts should simply output “Yes”. If they are not, the program should output “No”, followed by the first lines of each file that differ from each other. The input loop should read and compare lines from each file. The loop should break as soon as a...

  • Write a program that prompts the user to enter a length in feet and inches and...

    Write a program that prompts the user to enter a length in feet and inches and outputs the equivalent length in centimeters. If the user enters a negative number or a nondigit number, throw and handle an appropriate exception and prompt the user to enter another set of numbers. Using Python

  • Create a program in Python that will allow the user to enter a temperature in Fahrenheit...

    Create a program in Python that will allow the user to enter a temperature in Fahrenheit which will then be converted to degrees Celsius. The program will keep asking the user for a Fahrenheit temperature until the user enters Q to quit. After each conversion the program needs to print out the degrees Celsius. The input prompts for this problem need to look like the following: Degrees Fahrenheit: Continue: For these input prompts watch the capitalization and spacing. There are...

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