with open('guest.txt', 'w') as file_object:
    file_object.write(input("What is your name? ") + "\n")
    file_object.write(input("What is your name? ") + "\n")
    file_object.write(input("What is your name? ") + "\n")