Please use Python to solve the attached picture. I tried the answer below but it's not correct. The system said, "Your standard output is not what was expected." print("1 for January") print("2 for...


Please use Python to solve the attached picture. I tried the answer below but it's not correct. The system said, "Your standard output is not what was expected."



print("1 for January")

print("2 for February")

print("3 for March")

print("4 for April")

print("5 for May")

print("6 for June")

print("7 for July")

print("8 for August")

print("9 for September")

print("10 for October")

print("11 for November")

print("12 for December")

month = int(input("Enter the month in the year:- "))

year = int(input("Enter a year:- "))

if(month == 1 or month == 3 or month == 5 or month == 7 or month == 8 or month == 10 or month == 12):

    print("Number of days is 31")

elif((month == 2) and ((year%400==0) or (year%4==0 and year%100!=0))):

    print("Number of days is 29")

elif(month == 2):

    print("Number of days is 28")

else:

    print("Number of days is 30")

(Find the number of days in a month)<br>Write a program that prompts the user to enter the month and year and<br>displays the number of days in the month. For example, if the user entered<br>month 2 and year 2000, the program should display that February 2000 has 29<br>days. If the user entered month 3 and year 2005, the program should display<br>that March 2005 has 31 days.<br>Sample Run 1<br>Enter a month in the year (e.g., 1 for Jan): 4<br>Enter a year: 2005<br>April 2005 has 30 days<br>Sample Run 2<br>Enter a month in the year (e.g., 1 for Jan): 2<br>Enter a year: 2006<br>February 2006 has 28 days<br>Sample Run 3<br>Enter a month in the year (e.g., 1 for Jan): 2<br>Enter a year: 2000<br>February 2000 has 29 days<br>

Extracted text: (Find the number of days in a month) 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. Sample Run 1 Enter a month in the year (e.g., 1 for Jan): 4 Enter a year: 2005 April 2005 has 30 days Sample Run 2 Enter a month in the year (e.g., 1 for Jan): 2 Enter a year: 2006 February 2006 has 28 days Sample Run 3 Enter a month in the year (e.g., 1 for Jan): 2 Enter a year: 2000 February 2000 has 29 days
Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here