I encountered the problem when creating 2 inputs. The first one is Time, which converts seconds to minutes and seconds, as well as answering countdowns, and the second one is Clock, which converts minutes and seconds to only seconds. It's a very simple program but yet it ignores my if statement.
I tried making a function in order for it to recognize that Time has not been input yet. What actually happened was that it ignored the if statement and just seemed to execute line by line, without any thought into the actual code.
from time import*
print("""130s -> 2m, 10s = Time [T]
2m, 10s -> 130s = Clock [C]
""")
choose = input("Clock or Time? :")
if choose == "T" or "t" or "Time" or "time":
s = input("How many seconds? : ")
s = int(s)
t = s / 60
t = int(t)
time = s - int(t * 60)
prompt = input("Do you want it to countdown? [Y/N]: ")
if prompt == "Y" or "y":
for i in range(1,(s+1)):
print(str(t) + "m, " + str(time) + "s")
s = s - 1
time = time - 1
if time == -1:
time = time + 60
t = t - 1
sleep(1)
if s == 0:
print("You have reached the countdown.")
elif prompt == "N" or "n":
print("The result is: " + str(t) + "m, " + str(s - (t * 60)) + "s")
elif choose == "C" or "c" or "Clock" or "clock":
min = input("How many minutes? :")
sec = input("How many seconds? :")
if sec >= 60:
sec = sec - (sec / 60)
sec = sec + (min * 60)
print("Your result is " + sec + "s.")
Thanks.