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
|
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")
|
||||||
|
|||||||
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