Completed Exercise 8-13 User Profiles
This commit is contained in:
parent
8b70143137
commit
e8923133fd
16
Chapter_08/8-13_user_profile.py
Normal file
16
Chapter_08/8-13_user_profile.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Exercise 8-13 User Profile
|
||||||
|
# Learning Objective: Create a function that takes in two predefined key-value pairs and add 3 arbitrary ones.
|
||||||
|
|
||||||
|
|
||||||
|
# user_profile.py
|
||||||
|
def build_profile(first, last, **user_info):
|
||||||
|
"""Build a dictionary containing everything we know about a user."""
|
||||||
|
user_info['first_name'] = first
|
||||||
|
user_info['last_name'] = last
|
||||||
|
return user_info
|
||||||
|
|
||||||
|
user_profile = build_profile('mister', 'cheeks',
|
||||||
|
location='united states',
|
||||||
|
favorite_color='orange',
|
||||||
|
favorite_meal='scrambled eggs')
|
||||||
|
print(user_profile)
|
||||||
Loading…
x
Reference in New Issue
Block a user