i didn’t understood the if statement
if username in users and users[username]==password
I didn't understood the if statement
hey @Utkarsh-Madaan-2559055747708288 ,
This statement means ,we are checking two conditions at once .
first condition , we are checking whether a particular username exists in users dictionary
second condition , we are comparing password we provide and the respective password that is provided in the dictionary.
for example :
let users = {
‘me’:“mine”,
“you”:you"
}
username = “me”
password = “mine”
first condition checks if ‘me’ exists in users , which is True.
second condition checks users[username] = users[‘me’] = ‘mine’ ==password , which is True again.
Hence , this if statement is True and works.
I hope this would have helped you.
Thank You and Happy Learning .