Question: Write a Python program that reads a date from the user in numeric form. For example, 17 February 2003 would be entered as the three
Write a Python program that reads a date from the user in numeric form. For example, 17 February 2003 would be entered as the three integers 17, 2, and 2003. Your program must then determine if the date is a valid date. Use the following information to determine if the date is valid: January, March, May, July, August, October, and December all have 31 days. April, June, September, and November all have 30 days. February has 28 days in a non-leap year and 29 days in a leap year. Echo the input and print either valid date or invalid date as output.
Please go through my solution, this's should be solved using conditional statements (if statement, two ways if statement, multi ways if statement, ...etc). I'm stack I don't know how to solve it :)
1 2 "Exercise 6" d = int(input("Enter the day: ")) int(input("Enter the month: ")) y = int(input("Enter the year: ")) 3 m = 4 5 6 7. 8 9 10 11 12 13 Hif m==1 or m==3 or m==5 or m==7 or m==8 or m==10 or m==12: if 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
