Completed 10-4 Guest
This commit is contained in:
parent
96321d9bba
commit
b5e95f55f6
11
Chapter_10/10-04_guest.py
Normal file
11
Chapter_10/10-04_guest.py
Normal 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
1
Chapter_10/guest.txt
Normal file
@ -0,0 +1 @@
|
||||
Beans
|
||||
Loading…
x
Reference in New Issue
Block a user