Question: Write a function called acceptLogin(users, username, password)with three parameters: users - a dictionary of username, keys and password values, username a string for a login
Write a function called acceptLogin(users, username, password)with three parameters: users - a dictionary of username, keys and password values, username a string for a login name and password a string for a password. The function should return True if the user exists and the password is correct and False otherwise. Create a users dictionary with several users to test. Ask a user input for their username and password and print the message accordingly. Example for the test:
if acceptLogin(users, inputUsername, inputPassword) :
print("login successful!")
print ("login failed...")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
