LearnPy Hub
← If…Else problems
Hard

24-Hour to 12-Hour Time

Read a time HH:MM in 24-hour form and print it in 12-hour form as h:MM AM or h:MM PM. 00:xx is 12:xx AM and 12:xx is 12:xx PM.

Input

One line.

Output

One line.

Sample 1

Input
00:05
Output
12:05 AM

Sample 2

Input
12:00
Output
12:00 PM
solution.py
Output appears here
24-Hour to 12-Hour Time · Python practice problem · LearnPy Hub