From be086de29bb2520f2317133556aefe641e7f21f8 Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Sun, 9 Mar 2025 18:22:02 -0400 Subject: [PATCH] Completed Chapter 10-14 Verify User --- Chapter_10/10-14_verify_user.py | 6 +++--- Chapter_10/user_info.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 Chapter_10/user_info.json diff --git a/Chapter_10/10-14_verify_user.py b/Chapter_10/10-14_verify_user.py index 0170f1e..84b06eb 100644 --- a/Chapter_10/10-14_verify_user.py +++ b/Chapter_10/10-14_verify_user.py @@ -30,7 +30,7 @@ def get_information(path): return data def verify_user(information): - verification = input(f"Are you {information["username"]} (y/n)?") + verification = input(f"Are you {information['username']} (y/n)?") if verification.lower() == 'n' or verification.lower() == 'no': return False else: @@ -45,11 +45,11 @@ def greet_user(): if confirmed == False: entered_data = get_information(path) elif confirmed == True: - print(f"Welcome back, {information["username"]}! We remember that you are from {information["location"]} and that you are {information["age"]} years old since the last time you ran this.") + print(f"Welcome back, {information['username']}! We remember that you are from {information['location']} and that you are {information['age']} years old since the last time you ran this.") else: entered_data = get_information(path) print(f"We'll remember this information for when you come back: \n") for i in entered_data: print(f"{entered_data[i]}") -greet_user() \ No newline at end of file +greet_user() diff --git a/Chapter_10/user_info.json b/Chapter_10/user_info.json new file mode 100644 index 0000000..d6fdd14 --- /dev/null +++ b/Chapter_10/user_info.json @@ -0,0 +1 @@ +{"username": "Ken", "location": "PA", "age": "66"} \ No newline at end of file