Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Cedric Lefrancois](https://uploads.teamtreehouse.com/production/profile-photos/11565950/micro_IMG_8659.jpg)
Cedric Lefrancois
1,776 PointsWhen was "wishes" assigned its value?
Hi everyone,
I'm still pretty new to this and I don't understand how or when "wishes" was defined or assigned a value..
Thank you,
4 Answers
![Jennifer Nordell](https://uploads.teamtreehouse.com/production/profile-photos/5432702/micro_jen-square.jpg)
Jennifer Nordell
Treehouse TeacherHi there, Cedric Lefrancois! It was assigned a value the moment we called the function. The wishes
is a parameter in the function definition. A parameter is used to "catch" an argument at the moment we call/invoke/execute the function (however you prefer to say it).
For instance:
def say_hi(name):
print(f"Hi there, {name}")
Right now, name
has no value at all. It's an empty variable just waiting for something to be assigned to it.
However, if I were to do this:
say_hi("Cedric")
That calls the function and sends it the string "Cedric". Now name
does have a value and it is "Cedric"
.
The function shown here starts with:
def display_wishes(display_name, wishes):
At this point neither display_name
nor wishes
have any value whatsoever. But when I do this:
display_wishes("Video Games", video_games)
Then display_name
gets a value of the string "Video Games"
and wishes
gets whatever is stored in video_games
.
Hope this helps!
![Marisa Blanco](https://uploads.teamtreehouse.com/production/profile-photos/11563821/micro_BEAD84CD-E3E9-41D8-B68B-F5E172332A50.jpg)
Marisa Blanco
5,358 Points--- --- I actually had the same question and this broken down in a way that is very easy to understand for those of us who are starting from 0. Thank you for taking the time!
![Cedric Lefrancois](https://uploads.teamtreehouse.com/production/profile-photos/11565950/micro_IMG_8659.jpg)
Cedric Lefrancois
1,776 PointsThis is great! Thanks for taking the time to break this down and post examples as well. Super cool!
![Patrick Robinson](https://secure.gravatar.com/avatar/3c123a5ded08a947fb865b9e31ff387f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Patrick Robinson
623 PointsThank You so much! You made this so much simpler and clear!
justlevy
6,325 Pointsjustlevy
6,325 PointsVery helpful. Thanks!