Wednesday, 28 August 2013

Python programming language login error

Python programming language login error

I'm an absolute beginner to Python, but I have used visual basic.net a
little. I'm currently working on a login using a pair of lists as a form
of database but I'm receiving an error when running the module. Like I
said I'm an absolute beginner so it is probably something stupid, but any
help resolving this error would be really appreciated, thank you!
Here is the *.py file:
username = ["nathan","george"]
password = ["password","password"]
usrindex = 0
psswrdindex = 0
usrnm = input("username:")
while usrindex < len(usrnm):
if username[usrindex] == usrnm
Then psswrd = input("password:")
while psswrdindex < len(psswrd):
if password[psswrdindex] == psswrd
Then print("Success")
Else psswrdindex = psswrdindex + 1
Else usrindex = usrindex + 1
print("Failure")
when I try to run the module in IDLE it says that the syntax is invalid
and highlights this line:
if username[usrindex] == usrnm
like I said, any help would be really appreciated!

No comments:

Post a Comment