Help with this code please

I have this code that I’m using for my NEA and I have no idea what’s wrong with it

import time
usernames = ["a","b","c"]
passwords = ["1","2","3"]
index = 0
tries = 0
print("Welcome to The Dice Game")
while 1:
    print("Enter A to log in or enter B to sign up:")
    qw = input().upper()
    if qw == "A"or "B":
        break
    else:
        print("Please enter either A to go in or B to sign up")
if qw == "A":
    while 1:
        print("Please enter your username:")
        user1 = input()
        index = usernames.index(user1)
        print("Please enter your password:")
        passw1 = input()
        if pass1 == passwords[index]:
            pass1 == passwords[index]
            print("Player 1 logged in")
            break
                
    else:
        print("Incorrect")
        tries = 1 + tries
    if tries == 3:
        print("You have entered the username/password incorrect too many times")
        print ("You have been locked out for 10 minutes")
        time.sleep(600)
if qw == "B":
    while 1:
        signu = input("Please enter your new username:\t")
        usernames.append(signu)
        signp = input("Please enter your new password:\t")
        passwords.append(signp)
        signpc = input("Confirm your password:\t")
        if signp != signpc:
            print("Passwords don't match, try again")
        if signp == signpc:
            print("Account created")
            print("Now, please sign in")
            break
    while 1:
        print("Please enter your username:")
        plr1u = input()
        index = usernames.index(user1)
        print("Please enter your password:")
        plr1p = input()
        if pass1 == passwords[index]:
            pass1 == passwords[index]
            break
        else:
            print("Incorrect")
            tries = 1 + tries
        if tries == 3:
            print("You have entered the username/password incorrect too many times")
            print ("You have been locked out for 10 minutes")
            time.sleep(600)
print("Welcome")

    

The problem is on these lines:

while 1:
    print("Enter A to log in or enter B to sign up:")
    qw = input().upper()
    if qw == "A"or "B":
        break
    else:
        print("Please enter either A to go in or B to sign up")

It completely ignores the else and breaks out.
Help is much appreciated

This is the same as saying

if "B" or qw=="A":

which doesn’t really make sense.

Try

if qw=="A" or qw=="B":
2 Likes

Your if statement has a bug. it is always true because ` if “B” ’ will return true always.Try this instead

while (1):
    print("Enter A to log in or enter B to sign up:")
    qw = input().upper()
    if qw in ["A","B"]:
        break
    else:
        print("Please enter either A to go in or B to sign up")

I think the problem is with indentations