2025-03-03 18:18:56 +00:00

12 lines
333 B
Python

# Exercise 10-4 Guest
# Learning objective: Save information to a text file.
from pathlib import Path
guest_name = ""
guest_name = input("Welcome guest, what is your name?\n")
path = Path('./Chapter_10/guest.txt')
path.write_text(guest_name)
print(f"Thanks and Welcome {guest_name}, your name has been recorded in guest.txt.")