Python Python Basics Functions and Looping Create a Function

Dharani Marrikunta
Dharani Marrikunta
1,141 Points

can i know how to call a new function and pass it the argument 3. Under the function definition, call your

Great now that you have created your new square method, let's put it to use.

Under the function definition, call your new function and pass it the argument 3.

Since your square function returns a value, create a new variable named result to store the value from the function call.

squaring.py
def square(number):
    result = (number * number)
    return(result)
results = square(3)

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 48,707 Points

If you click preview you'll see AssertionError: unexpectedly None : Make sure you create a new variable named result.

You have results. It should just be result.