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
Get step-by-step solutions from verified subject matter experts
