name = input("input your name: ") with open("guest.txt", 'w') as file_object: file_object.write(name)
while True: guest_name = input("Input your name: ") print("Hello ,", guest_name) with open("guest_book.txt", 'a') as file_object: file_object.write(guest_name+"\n")