I want to add an error message after every incorrect log in.
def login():
Username=''
Password=''
counter=0
for line in open("Credentials.txt","r").readlines(): # Read the lines
login_info = line.split() # Split on the space, and store the results in a list of two strings
while Username != login_info[0] and Password != login_info[1]: #If the username and password do not match the string elements from the txt file, starts the loop
while not (Username == login_info[0] and Password == login_info[1]):
Username = input("Please enter your username: " ) #get elements from the user
Password = input("Please enter your password: ")
print("welcome")
break
login() # call the function