Completed 10-4 Guest

This commit is contained in:
cheeks 2025-03-03 18:18:56 +00:00
parent 96321d9bba
commit b5e95f55f6
2 changed files with 12 additions and 0 deletions

11
Chapter_10/10-04_guest.py Normal file
View File

@ -0,0 +1,11 @@
# 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.")

1
Chapter_10/guest.txt Normal file
View File

@ -0,0 +1 @@
Beans