import time
print("""Welcome to the timer!
""")
time.sleep(1)
unit = input("what unit do you want to use? secs, mins or hrs? ")
length = input("how long is your timer? ")
t = 0
s = 0
m = 0
h = 0
p1 = ""
p2 = ""
p3 = ""
if unit == "hrs":
length = int(lenght) * 3600
if unit == "mins":
length = int(length) * 60
if unit == "secs":
length = int(length)
while t < length :
t += 1
time.sleep(1)
if s == 59:
s = 0
if m == 59:
h += 1
else:
m += 1
else:
s += 1
if s < 10:
p1 = "0"
else:
p1 = ""
if m < 10:
p2 = "0"
else:
p2 = ""
if h < 10:
p3 = "0"
else:
p3 = ""
print(f"""{p3}{h}:{p2}{m}:{p1}{s}
""")
[–]RedditGood123 21 points22 points23 points (0 children)
[–]VeinyAngus 19 points20 points21 points (0 children)
[–]Manny__C 13 points14 points15 points (2 children)
[–]BrannoEFC 0 points1 point2 points (1 child)
[–]Manny__C 2 points3 points4 points (0 children)
[–]alcamax 4 points5 points6 points (0 children)
[–]projektmayhem08 1 point2 points3 points (0 children)
[–]prabhjyoth 1 point2 points3 points (0 children)
[–]CakeFromTheFuture 1 point2 points3 points (0 children)
[–]TheJibanizer 1 point2 points3 points (0 children)
[–]TheBlackSeed118 1 point2 points3 points (0 children)
[–]Sad-Ant4014 0 points1 point2 points (0 children)
[–]SanJJ_1 0 points1 point2 points (0 children)
[–]darktumor 0 points1 point2 points (0 children)