-1

I was trying to make a simple timer and countdown in python, but for the first question, where you pick either timer or countdown, no matter what you type, it gives you the timer instead of countdown. How do i change this?

    import time
    def resetVar():
x = input("Timer or countdown?:")
minsum = int(input("How long do you want the timer to go?: "))
reminder = int(input("How often do we notify you in minutes?: "))
mins = 0
countminsum = 0
mins = 0
x = input("Timer or countdown?:")
if(x == "Timer" or "timer"):
    minsum = int(input("How long do you want the timer to go?: "))
    reminder = int(input("How often do we notify you in minutes?: "))
    print("Countdown has started.")
    while mins != minsum:
        time.sleep(reminder * 60)
        mins += reminder
        print(str(reminder) + " Minute(s) have passed")

    if mins == minsum:
        print("timer has ended")
        resetVar()
        print(x)
if(x == "Countdown" or "countdown"):
    countminsum = int(input("How long shout the countdown go for?: "))
    remider = int(input("How often should we notify you how much time is left? (in minutes): "))
    print ("countdown has started")
    while countminsum != mins:
            time.sleep(remider * 60)
            countminsum -= remider
            printe(str(remider) + " Minute(s) have passed.")

    if countminsum == 0:
        print ("Countdown has ended.")
        resetVar()
        print (x)
808shz
  • 1
  • 1

1 Answers1

0

You can't check if x is timer or Timer like that, as it evaluates to x == 'Timer', ("Timer" or "timer" == 'Timer'), instead you can say x in ['timer', 'Timer'].

The same goes for countdown.

Karan Elangovan
  • 688
  • 1
  • 7
  • 14