Ask Question
2 July, 20:44

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.

+3
Answers (1)
  1. 2 July, 20:57
    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 you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers