You the following code:
%H Hour (24-hour clock) as a zero-padded decimal number. 00, 01, …, 23
%I Hour (12-hour clock) as a zero-padded decimal number. 01, 02, …, 12
You need to input like 12:07 am for the time to be valid (there is no 0 o'clock in the 12-hour clock)
Do check out data science with python certification to understand from scratch