Question
3.19 Clone of LAB: Convert to seconds in PYTHON Write a program that reads in hours, minutes, and seconds asinput, and outputs the time in
3.19 Clone of LAB: Convert to seconds in PYTHON
Write a program that reads in hours, minutes, and seconds asinput, and outputs the time in seconds only.
Ex: If the input is:
1640
where 1 is the number of hours, 6 is the number of minutes, and40 is the number of seconds, the output is:
Seconds: 4000
If this helps its the solution kind of:
# get the number of hours, minutes, and seconds from theuser
hours = int(input())
minutes = int(input())
seconds = int(input())
# calculate number of seconds from hours (3600 seconds in anhour)
seconds += hours * 3600
# calculate number of seconds from minutes (60 seconds in aminute)
seconds += minutes * 60
print(f'Seconds: {seconds}')
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started