Question: Write a function time convert() that takes one argument, original, which is a string that represents the time in 24-hour format, which has the format
Write a function time convert() that takes one argument, original, which is a string that represents the time in 24-hour format, which has the format HH:MM

Please use python to solve the problem.
Part III: Time Converter (20 points) Write a function time.convert () that takes one argument, original, which is a string that represents the time in 24-hour format, which has the format HH : MM (with always two digits each for the hour and the minutes) The 24-hour time has the range 00:00 through 23:59. Note: In the 24-hour format described above, the semicolon is optional Your function should take the 24-hour formatted string and check if it is valid. If so, convert the 24-hour time to the 12-hour standard format describe below and return the new format. If the 24-hour time is invalid, return invalid format'. The converted time starts with (1) two digits that represent the hour, followed by (2) a semicolon ': ', then (3) another two digits that represent the minutes, then (4) one space, and finishing with (5) 'AM' or PM' Note: The hour and the minutes in the 12-hour time also need to be 2 digits CSE 101 - Fall 2017 Lab #1 1 Page 3 Examples: Return Value Function Call time.convert '23:59')11:59 PM' time.convert (0000') time.convert ('12:59''12:59 PM' time.convert (01:10) 01:10 AM time.convert ('1733) time.convert'24:00''invalid format' time.convert ('13:13'1:13 PM 12:00 AM' 05:33 PM vert(' 8:55')'invalid format time.convert (1621')'04:21 PM time.convert (05:05' 05:05 AM" time.convert ('12:00''12:00 PM time.convert ('14:07')02:07 PM
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
