Question: 2) (20 points) Write a Python script named isValidTime.py that Take 1 string as an argument and determine if it is a valid time in

2) (20 points) Write a Python script named "isValidTime.py" that Take 1 string as an argument and determine if it is a valid time in 12-hour am/pm format. Hour must be between 1 and 12 and can have 1 or 2 digits. Minutes must be between 0 and 59 and must have 2 digits. Example: "7:35 am" and "09:59 pm" are valid, while "7:65 am" and "15:25 pm" are not valid The am/pm part is valid only if both characters are uppercase, or both characters are lowercase. Example: "AM", "PM", "am", and "pm" are all valid while "aM", "pM", Am", "Pm" are not valid The space between the minute portion and am/pm portion is optional. Example "7:35am" and "7:35 am" are both valid If valid print "valid time", otherwise print "invalid time" If there is not exactly 1 argument, print an error message and exit a. b. c. d. e. f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
