DEV Community

Amit Kshirsagar
Amit Kshirsagar

Posted on

Converting Day, Hour, Min, Sec By using Python

program on converting into day, hour, min, sec hours

d=int(input("Enter the Day:"))
h=d*24
m=h*60
s=m*60
print(""*50)
print("\t\tconverting day,hour,min,sec ")
print("
"50)
print(f"\t\t{d} day = {h} H ")
print(f"\t\t{h} hour= {m} min ")
print(f"\t\t{m} min``= {s} sec ")
print("
"*50)

output:

Enter the Day:3


    converting day,hour,min,sec 
Enter fullscreen mode Exit fullscreen mode

                3 day    = 72 H 
                72 hour  = 4320 min 
                4320 min = 259200 sec 
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
grantdotdev profile image
Grant Riordan

Mod - More discussion - explanation is needed. A brief introduction as to what your code is doing perhaps.