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 Pointsreally don't know what's wrong?
Create a function named apply that should take three arguments: a function and two arguments. apply should return the result of calling the function with the two arguments. Bummer! apply() takes 2 positional arguments but 3 were given Preview Get Help Recheck work functions.py
_yourjob 1 def apply(for_find_yourjob,for_text_yourjob): 2 print("Apply!") 3
4 print("log and run:") 5 log_and_run(apply) 6
7 print("log and return:") 8 hola=log_and_return(apply) 9 hola()
def apply(for_find_yourjob,for_text_yourjob):
print("Apply!")
print("log and run:")
log_and_run(apply)
print("log and return:")
hola=log_and_return(apply)
hola()
1 Answer
Bryan Manhollan
Courses Plus Student 9,608 PointsFirst I think you're over complicating it. Stick with easier arguments within the method. Also, remember its asking for a "return", not "print". That makes a difference.
Another thing to remember is that doing "print("Apply")" will not call your apply method. This will simply print out the string "Apply". To call a function you would do; apply().
def apply(fun, arg1, arg2):
return fun(arg1, arg2)
shawn khah
15,082 Pointsshawn khah
15,082 Pointsthanks Bryan manhollan