Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

In python please solve that Using basic logic operation and if else loops only no advanced codes While loops And or only Create a program

In python please solve that Using basic logic operation and if else loops only no advanced codes
While loops
And or only
image text in transcribed
Create a program named lastname A34% that prompts the user to enter to numbers: a month (1-12) and a year. Print the number of days in that month. April, June, September and November always have 30 days. January, March, May, July, August, October and December always have 31 days February has 28 days; if it is a leap year, then February has 29 days A leap year occurs when: . The year is evenly divisible 100 and also evenly divisible by 400, or .The year is not evenly divisible by 100 but is evenly divisible by 4. Your program should validate the users input in the following ways: The value for the month must be between 1 and 12. The value for the year must be greater than 1000. . . If the user entered an invalid month or year value, print an error message and prompt the user to try entering the value again. Sample Input/Output Enter a month (1-12): 15 Invalid month. Please try again. Enter a month (1-12)-2 Invalid month. Please try again. Enter a month (1-12): 1 Enter a year (1000) 2001 There are 30 days in 1/2001. Enter a month (1-12) A9 Enter a year G109 0) 200

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions