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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!