Python Python Basics Functions and Looping Create a Function

Trevor Funk
Trevor Funk
2,366 Points

stuck on create a function challenge 2 of 2

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):
    return (number * number)

result= square * 3

1 Answer

KRIS NIKOLAISEN
KRIS NIKOLAISEN
53,705 Points

Maybe it's easier than you think. Just call the function and store the result.

def square(number):
    return (number * number)

result = square(3)