
Time Converter (12h to 24h)
You are the modern man who prefers the 24-hour time format. But the 12-hour format is used in some places. Your task is to convert the time from the 12-h format into 24-h by following the next rules:
- the output format should be 'hh:mm'
- if the output hour is less than 10 - write '0' before it. For example: '09:05'
Here you can find some useful information about the
12-hour format
.
Input: Time in a 12-hour format (as a string).
Output: Time in a 24-hour format (as a string).
Example:
time_converter('12:30 p.m.') == '12:30' time_converter('9:00 a.m.') == '09:00' time_converter('11:15 p.m.') == '23:15'
How it is used: For work with the different time formats.
Precondition
:
'00:00' <= time <= '23:59'
Also interesting fact about "12:00 p.m." and "12:00 a.m.". The name of this fact is "Confusion at noon and midnight" - problem using "p.m./ a.m." with this magical time "12:00". You can find information about this in Wikipedia or just google it.
CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.
In order to install CheckiO client you'll need installed Python (version at least 3.8)
Install CheckiO Client first:
pip3 install checkio_client
Configure your tool
checkio --domain=py config --key=
Sync solutions into your local folder
checkio sync
(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)
checkio serv -d
Alternatevly, you can install Chrome extension or FF addon
checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium
Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.