Completed Chapter 10-14 Verify User
This commit is contained in:
parent
e01dcd792e
commit
be086de29b
@ -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()
|
||||
greet_user()
|
||||
|
||||
1
Chapter_10/user_info.json
Normal file
1
Chapter_10/user_info.json
Normal file
@ -0,0 +1 @@
|
||||
{"username": "Ken", "location": "PA", "age": "66"}
|
||||
Loading…
x
Reference in New Issue
Block a user