Q:

Write a Python program Convert all units of time into seconds

belongs to collection: python basic programs with examples

0

Write a Python program Convert all units of time into seconds

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

I have used python 3.7 compiler for debugging purpose.

days = int(input("Input days: ")) * 3600 * 24
hours = int(input("Input hours: ")) * 3600
minutes = int(input("Input minutes: ")) * 60
seconds = int(input("Input seconds: "))
 
Totaltime = days + hours + minutes + seconds
 
print("The  amounts of seconds", Totaltime)

Result:

Input days: 5

Input hours: 10

Input minutes: 2

Input seconds: 1

The  amounts of seconds 468121

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

python basic programs with examples

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a Python program to Calculate body mass inde... >>
<< Write a Python program to convert the distance (in...