-2
username ="fay"
password ="321"
user_name = input("What is your username?:")
if user_name==username:
    passWord= input("Please enter your password:")
    if passWord == password:
        print("welcome!")
    else:
        password_=("please re-enter password:")
else:
    user_name=("please re-enter username:")

#i wanted it to check the username and ask for username again if it's wrong and check password if it's correct and to ask for the password again if it's incorrect`

1 Answers1

-1

I think you should to try this:

username ="fay"
password ="321"
user_name = input("What is your username?:")
while user_name!=username:
    user_name=input("please re-enter username:")

passWord= input("Please enter your password:")

while passWord != password:
    passWord=input("please re-enter password:")  
 
print("welcome!")