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 trialshawn khah
15,082 PointsCreate a function named apply that should take three arguments: a function and two arguments. apply should return the re
really dont know what's wrong!?
def say-apply():
print('apply!')
print("log and run:")
log-and-run(say-apply)
print("log and return")
log-and-return(say-apply)
1 Answer
Andreas cormack
Python Web Development Techdegree Graduate 33,011 PointsHi Shawn
The challenge asks you to create a function named apply that takes three arguments one a function and the other two just normal arguments, the function apply should return the result of the passed in function applying the other two passed in arguments to the passed in function in my case myfunc.
def apply(myfunc,arg1,arg2):
return myfunc(arg1,arg2)
You dont need to print out strings in the function apply.