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)
![Kyle McCullen](https://uploads.teamtreehouse.com/production/profile-photos/9495952/micro_fd.jpg)
Kyle McCullen
16,639 PointsReturning function call vs just calling the function
I am taking the python functional programming course. In the functions.py file there is a function as follows . . .
def log_and_run(func):
print("I just got {}".format(func.__name__))
return func()
I would like to know the difference in returning a function call at the end of a function, and just calling the function like below . .
def log_and_run(func):
print("I just got {}".format(func.__name__))
func()
1 Answer
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsIn both examples the function "func" will run, but in the first example any value returned by "func" will then also be returned by "log_and_run" to the code that called it.
In the second example, "log_and_run" does not return any value, and anything that "func" might have returned is lost.
Kyle McCullen
16,639 PointsKyle McCullen
16,639 PointsOkay I see now thanks! It was not clear in the example from the video because the function used did not have a return value.