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 trialJiyan Baran Bukun
1,837 PointsWhat if function returns the num?
If the function return num at the end then will num be updated from 10 to 5? Thanks.
1 Answer
Steven Parker
231,269 PointsReturning a value from the function will not affect the calling environment by itself.
Now if you wanted to change the original "num", you could also reassign it using that returned value:
num = set_num()
Jiyan Baran Bukun
1,837 PointsJiyan Baran Bukun
1,837 PointsThank you very much.