This Is a system where the user can recover their username or password
account = input("What do you want to recover? Username or Password? ")
if account == ("Password") or account == ("password"):
check = True
while check:
username = input("Enter your username for your account ")
with open("accountfile.txt","r") as file:
for line in file:
text = line.strip().split()
if username in text:
print(line)
check = False
else:
print("Username not found")
The format in the text file is: username: (username) password: (password) For some reason when I enter the username for the account it gives the password for it but for some reason it says at the end Username not found and I don't know how to fix this.

