Python Challenge 2

Python Challenge:

Below is a code that uses lists of users and lists of passwords. 
The correct username and password must be entered to log into the system. 

Tasks:
Copy the program into python to see how it works. 
Find out what happens if incorrect usernames are entered.
Find out what happens if incorrect passwords are entered.
Find out what happens if the wrong password is entered 3 times.
Change the code so that users have 5 attempts to get the password right.
Add more users and more passwords to the system.
Add #comments to the code to explain what is happening.
Try to develop the code further and improve it.



def login():
    official_users=['dan','bob','bill']
    official_passwords=['snow','golf','dogs']
    username=input("Enter your user name: ")
    while username in official_users:
        print("You are user number: ",official_users.index(username)+1)
        position=(official_users.index(username))
        print(position)
        attempts=0
        while attempts<3:
            password=input("Enter your password: ")
            if password == official_passwords[position]:
                print("Log in successfull")
                print("Hello",username)
                login()
            else:
                print("Incorrect password")    
                attempts+=1
                print("Attempts left: ",3-attempts)
                if attempts==3:
                    print("Too many attempts!")
                    login()
    print("Unknown User")
    login()

login()