Write a Python program Convert all units of time into seconds


Introduction

Write a Python program Convert all units of time into seconds. I have used python 3.7 compiler for debugging purpose.


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. days = int(input("Input days: ")) * 3600 * 24
  2. hours = int(input("Input hours: ")) * 3600
  3. minutes = int(input("Input minutes: ")) * 60
  4. seconds = int(input("Input seconds: "))
  5.  
  6. Totaltime = days + hours + minutes + seconds
  7.  
  8. print("The amounts of seconds", Totaltime)

Result

python language techstudy.org

     





Related Topics




Popular Posts