Python Python Basics Functions and Looping Create a Function

Blue DiamondXD
Blue DiamondXD
2,056 Points

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.

Oskar Lundberg
Oskar Lundberg
9,504 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?

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.