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

In the body of the function, return the square of the value that was passed in. (A **square* is the value multiplied b

can some some explain what it mean without giving the answare

squaring.py
def square(number):
    return number * 4

4 Answers

You're multiplying the number by 4 instead of squaring it. The question explains what it means to square something.

i dont get it

Oskar Lundberg
Oskar Lundberg
9,534 Points

I will just leave a solution here for you, in case you still need help. Step 1/2

def square(number):    
    return number*number

Step 2/2

def square(number):    
    return number*number

result = square(3)

Did you read the question? What part don't you get?

what to do

It says "return the square of the value that was passed in" so that's what you're supposed to do. It tells you what that means: "A *square is the value multiplied by itself." In the body of the function you need to return the square of number.