-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseconds.py
More file actions
16 lines (13 loc) · 551 Bytes
/
seconds.py
File metadata and controls
16 lines (13 loc) · 551 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python3
def to_seconds(hours, minutes, seconds):
return hours*3600+minutes*60+seconds
print("welcome to this time converter")
cont = "y"
while(cont.lower() == "y"):
hours = int(input("Enter the number of hours: "))
minutes =int(input("Enter the numbers of minutes: "))
seconds = int(input("Enter the number of seconds: "))
print("That's {} seconds" .format(to_seconds(hours, minutes, seconds)))
print()
cont = input("Do you want to do another conversion? [y to continue] ")
print("Good bye!")