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

I'm a beginner, I can't complete the Challenge Task. I have no idea what I made mistake ;(

Bummer: AssertionError: 25 != 9 : Make sure you store the return value from the function in a variable named result

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

2 Answers

I think it wants you to store the "number * number" in the variable result (inside the function) and then return the variable.

Let me know if you don't know what I mean.

Thank you for helping me so promptly! I did it!

Hi,

I don't know the details on the question, but it looks like you need to assign the result in the function and then return the result.

And tip: we almost never have to call the function. We just have to provide it. The calling is done in the evaluation, for us. And no printing. I did that and it never passed...

Thank you for your advice!