LearnPy Hub
← Regular Expressions problems
Hard

Valid 24-hour Times

Read times until END and print ok if the line is a valid 24-hour time HH:MM (00:00 to 23:59), otherwise bad.

Input

Lines, then END.

Output

One line each.

Sample 1

Input
23:59
24:00
9:30
END
Output
ok
bad
bad

Sample 2

Input
00:00
END
Output
ok
solution.py
Output appears here
Valid 24-hour Times · Python practice problem · LearnPy Hub