From e8923133fd519c61ef4b5e26a1ff725fce817585 Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Fri, 21 Feb 2025 14:04:52 +0000 Subject: [PATCH] Completed Exercise 8-13 User Profiles --- Chapter_08/8-13_user_profile.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Chapter_08/8-13_user_profile.py diff --git a/Chapter_08/8-13_user_profile.py b/Chapter_08/8-13_user_profile.py new file mode 100644 index 0000000..52d33ed --- /dev/null +++ b/Chapter_08/8-13_user_profile.py @@ -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) \ No newline at end of file