Hi I am a uni student and this is the first time I am taking a programming subject. I am struggling to create a simple login program that takes two inputs and checks if there is a successful login combination.
Here is the code Ive got so far... thanks in advance for any help!
#Inputs username and password
#If the inputs match the accounts
#Outputs "welcome back <username>"
#If the inputs dont match the accounts
#Output "Wrong username or password"
#Initialising variables
use1 = "alice"
use2 = "bob"
use3 = "carol"
ans1 = "greenfingers"
ans2 = "builder"
ans3 = "danvers"
login1 = input("Username: ")
login2 = input("Password: ")
if (login1 == use1 or use2 or use3):
if (login2 == ans1 or ans2 or ans3):
print("Welcome back {}".format(login1))
else:
print("Wrong username or password")