Python Python Basics Functions and Looping Create a Function

Storing a function value

Hello,

How to store the function value in the var result?

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

2 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 33,815 Points

The task specifies: Under the function definition, call your new function and pass it the argument 3. Replace number with the value 3 and you will pass.

def square(number):
    x = number * number
    return x
result = square(3)

Thanks for your answer Kris.