Question: 5.5.2: Write a python program that does the following: . takes as input from the user a date and time (24-hour clock) as MM/DD/YYYY HH:mm:SS

 5.5.2: Write a python program that does the following: . takes

5.5.2: Write a python program that does the following: . takes as input from the user a date and time (24-hour clock) as "MM/DD/YYYY HH:mm:SS" 0 Assume that everything must be provided with leading zeros calls the function is_valid_datetime () that: 0 takes a string argument o validates that the string has all the elements to be a valid date and time o returns 2 values: Boolean true if valid or false if invalid date/time None if valid or an error message string if invalid . If the input string is returned from the function as invalid, print the returned error message. . If the input string is returned from the function as valid, use input string to print following: O DD/MM/YYYY O HR:MIN:SEC O MM/YYYY o Whether the time is "AM" or "PM" You must write your own algorithms. Do not use existing functions like datetime.strptime Example 1: Enter a date time (MM/DD/YYYY HR: MIN : SEC) : 12/13/2020 11:31:41 DD/MM/YYYY is 13/12/2020 HR : MIN : SEC is 11:31:41 MM/YYYY is 12/2020 The time is AM

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!