I am receiving no errors, but it does not seem to check for the text in my file, as it will append anything you input. Can anyone help?
guest_name = input("What is your name: ")
with open("guests.txt", "a+") as guests_txt:
names = guests_txt.readlines()
def find_name():
if guest_name.lower() in names:
print("Your name is already taken.")
name_taken = True
return name_taken
name_taken_function = find_name()
if not name_taken_function:
guests_txt.write(f"{guest_name.lower()}\n")