Completed Chapter 10-14 Verify User

This commit is contained in:
cheeks 2025-03-09 18:22:02 -04:00
parent e01dcd792e
commit be086de29b
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,7 @@ def get_information(path):
return data return data
def verify_user(information): 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': if verification.lower() == 'n' or verification.lower() == 'no':
return False return False
else: else:
@ -45,7 +45,7 @@ def greet_user():
if confirmed == False: if confirmed == False:
entered_data = get_information(path) entered_data = get_information(path)
elif confirmed == True: 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: else:
entered_data = get_information(path) entered_data = get_information(path)
print(f"We'll remember this information for when you come back: \n") print(f"We'll remember this information for when you come back: \n")

View File

@ -0,0 +1 @@
{"username": "Ken", "location": "PA", "age": "66"}