My task was to create a program that can recheck the password and username and it works except for one flaw. If the username or password does not match it says "Input details again" and loops it like I want it to but if it matches it breaks and the program stops but before that it says "Input details again". How can I fix it so if the user details match then it prints "Good!" like I want it to and not "Input details again" like its doing.
import time
complete = False
user = [["username",""],["password",""]]
def Access():
for n in range (len(user)):
user[n][1] = input(user[n][0])
while not complete:
Access()
username = input("Reinput the username?")
password = input("Reinput the password?")
if username == user[0][0]:
print("Good!")#what i want it to print if correct
else:
print("Input details again!")#what it keeps printing no matter what
if password == user[1][1]:
print("User has been identified, Welcome", username)
complete = True
break