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

Python Python Basics Functions and Looping Create a Function

Mike Buenaventura
Mike Buenaventura
195 Points

Hello everyone. I just need the solution/answer for Challenge Task 2 of 2 please for functions. Thanks.

Does anyone have the solution/answer for Challenge Task 2 of 2 for functions please? Thanks.

squaring.py
def square(number):
    return (number * number)
result = square(5)
print(result)

1 Answer

Laura Coronel
STAFF
Laura Coronel
Treehouse Teacher

Hi Mike Buenaventura,

You're very close! 😊

Take another look at the instructions for Task 2. The challenge asks you to call the square() function and pass it the argument 3 (three).

Right now you're passing 5 (five):

result = square(5)

Try changing that line to use the value specified in the instructions and see if the challenge passes.

If you get stuck after that, let us know and we'll be happy to help further!