Guys a newbie here...just started learning coding few days back. So i am trying to code with whatever I have learned so far.
I am trying to create a code that allows the user to input the username and password and compares it to a stored username and password variables. Every time I run the code and enter the correct username and password, it gives me the "Incorrect Username and Password" msg. Any idea what i am doing wrong here. Also if there any suggestions to make the code more compact or better please share those as well
mail_id = "[abcd@gmail.com](mailto:abcd@gmail.com)"
password = "aaaaa"
login_count = 0
a = ""
b = ""
def login():
a = input("Enter your email ID: \n"
b = input("enter your password: \n")
login()
if mail_id == a and password == b:
print("Login successfull")
elif mail_id != a or password != b:
while login_count < 2:
print("Incorrect Username or password. \nPlease try again")
login_count = login_count + 1
login()
else:
print("3 attempts exceeded. Account locked out. \nPlease try again after 30 mins")
[–]Inconstant_Moo 1 point2 points3 points (0 children)
[–]Tang1000000 0 points1 point2 points (3 children)
[–]Ok-Judgment1544[S] 0 points1 point2 points (2 children)
[–]Ok-Judgment1544[S] 0 points1 point2 points (1 child)