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

can anybody help me with this one im soo stumped

dont get it

squaring.py
def square(number):
    number = number * number

number = 5

2 Answers

You're pretty close on this. Remember that your function needs to return something at the end. The squared value of a number is number * number, as you've already written, but at the moment your function doesn't return that value at any point. You can make a small change to that line to get it to work.

Also on line four, you don't need to assign anything to number. The question doesn't ask you to call the function, but the syntax for that would just be square(5)

Hello, It got me too for a while, I found walking a way for a few hours and then coming back to it helped a great deal. Also I was in to much of a rush to read the question properly. So was not doing what the question was actually asking for. Hope this helps