I want to append a name entry to a file while the end variable is True, the prompt should reappear every time an entry as been added to the file, the loop should stop once the user enters 'end' or 'no' in the prompt.
here's the what I have tried:
end = True
while end:
guest = input("Enter your name here: ")
if guest.lower() =='end' or 'no':
end= False
break
with open('Desktop/guestbook.txt', 'a') as file:
file.write(f'{guest} visited.\n')
print(f"You are welcome to SRL, {guest}.")
but it doesn't repeat the prompt, after the first entry the code stops, how can i solve this?