Question: Using python IDLE only not java or other system ... 5. Read in a time such as 3 pm and print the equivalent military hour
Using python IDLE only not java or other system

... 5. Read in a time such as 3 pm and print the equivalent military hour (such as 15). Validate the input. . If the number isn't between 1 and 12, print: Error: The hour must be between 1 and 12. o If the suffix isn't "am" or "pm", print: Error: The suffix must be am or pm. verifytime.py 1 hour = int(input("Enter the hour: ")) 2 if...: 3 suffix = input("Enter the suffix: ") 4 suffix suffix. lower() 5 if...: 6 7 # Convert hour to military time. 8 9 print(hour) 10 else : 11 print("Error: The suffix must be am or pm.") 12 else : 13 print("Error: The hour must be between 1 and 12.") CodeCheck Reset
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
