I’m not able to drag and drop images on Chrome for Mac, so, I’ll share the snippet of code.
users = {“Harry”: “Password”,
“Mark”: “Code”}
def login(username,password):
if username in users and users[username] == password:
print(“Hello World”)
else:
print(“Not Authenticated”)
Could you please help me with the line:
if username in users and users[username] == password ?
I don’t understand how ‘username’ connects to the dictionary ‘users’.
Is the function argument ‘username’ used as a key from the dictionary which equates to the argument ‘password’?