From 9746551d7d7909fc7dbbac4e284921910e758574 Mon Sep 17 00:00:00 2001 From: Stefano Agnelli Date: Sun, 28 Apr 2024 19:19:46 +0200 Subject: [PATCH] added solution m1/004 --- projects/004-units-of-time/python/main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/projects/004-units-of-time/python/main.py b/projects/004-units-of-time/python/main.py index e69de29..d27d7de 100644 --- a/projects/004-units-of-time/python/main.py +++ b/projects/004-units-of-time/python/main.py @@ -0,0 +1,20 @@ + +d_day = int(input("Insert Days duration:")) + +d_hours = int(input("Insert Hours duration:")) + +d_minutes = int(input("Insert Minutes duration:")) + +d_seconds = int(input("Insert Seconds duration:")) + +print("Your duration is: ", d_day, "days", d_hours, "hours", d_minutes, "minutes", d_seconds, "seconds") + +tot_d = d_day*86400 + +tot_h = d_hours*3600 + +tot_m = d_minutes*60 + +tot_duration = tot_d + tot_h + tot_m + d_seconds + +print("The duration in seconds is: ", tot_duration, "seconds")