feat: add human readable time solution for aufgabe1 #3
12
src/human_readable_time.py
Normal file
12
src/human_readable_time.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Codewars: Human Readable Time
|
||||||
|
|
||||||
|
def make_readable(seconds):
|
||||||
|
minutes_sec = 60
|
||||||
|
hour_sec = minutes_sec * 60
|
||||||
|
|
||||||
|
hour = seconds // hour_sec
|
||||||
|
seconds = seconds % hour_sec
|
||||||
|
minutes = seconds // minutes_sec
|
||||||
|
seconds = seconds % minutes_sec
|
||||||
|
|
||||||
|
return f"{hour:02}:{minutes:02}:{seconds:02}"
|
||||||
Loading…
x
Reference in New Issue
Block a user