Hello everyone here is my simple code for a simple login :
def Login(username , password): i = 1 while i<5 : username = int(input("Enter your username: ")) password = int(input("Enter your password: ")) if username == "Test" and password == "Test123": return print("Successful Login") break else : return print("username or password is wrong") i += 1
First, remove the parameters username and password from line 1: def Login(username , password): -> def Login(): put this at the bottom of your code: Login()
Get rid of the return print() statements and just print() first and then just put "return" at the end.
Hello everyone
here is my simple code for a simple login :
def Login(username , password):
i = 1
while i<5 :
username = int(input("Enter your username: "))
password = int(input("Enter your password: "))
if username == "Test" and password == "Test123":
return print("Successful Login")
break
else :
return print("username or password is wrong")
i += 1
my question is how can I call it ?
First, remove the parameters username and password from line 1:
def Login(username , password): -> def Login():
put this at the bottom of your code:
Login()
Get rid of the return print() statements and just print() first and then just put "return" at the end.