Ask Question
17 November, 23:01

python Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2000, the program should display that February 2000 has 29 days. If the user entered month 3 and year 2005, the program should display that March 2005 has 31 days.

+4
Answers (1)
  1. 17 November, 23:30
    0
    program

    Explanation:

    Program that prompts the user to enter the month and year and displays the number of days in the month:

    1. print ("List of months: January, February, March, April, May, June, July, August, September, October, November, December")

    2. month_name = input ("Input the name of Month: ")

    if month_name = = "February":

    print ("No. of days: 28/29 days")

    elif month_name in ("January", "March", "May", "July", "August", "October", "December"):

    print ("No. of days: 31 day")

    elif month_name in ("April", "June", "September", "November"):

    print ("No. of days: 30 days")

    else:

    print ("Wrong month name")
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “python Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers