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

ursaminor
ursaminor
10,035 Points

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,211 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)
ursaminor
ursaminor
10,035 Points

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

what to do

ursaminor
ursaminor
10,035 Points

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.