I am developing a basic registration and login code for a school project. I have created a dict which has some keys and values as usernames and passwords but when entering a password of a different username to another username, the code validates and continues. I want the code to check the value for the specific username and validate it.

I am just a beginner and this just a rough code of my project.

```
fa='Y'
while fa=='y' or fa=='Y':
    user_name=input("Enter Username : ")
    password=input("Enter Password : ")
    if user_name in up.keys():
        if password in up.values():
            print("Valid Username and Password.Login Completed")
        else:
            print("Invalid Password for the Usename. Login Failed")
    else:
        print('Invalid Username. Register to Login ')
    fa=input("Login Again (Y) :")
print(up)

```