Python Python Basics Functions and Looping Create a Function

Luis Barahona
Luis Barahona
814 Points

new function

 def square(number):
    result = (number * number)
results = square(3)
def result(number, result):
    return 3 * 3

1 Answer

Ernestas Petruoka
Ernestas Petruoka
1,855 Points

Well you not exacly doing what teacher asked :)

You do not need create new function you just simply need use your old one and store result in the variable named result. So you create variable named return and then call a function named square with argument 3. You do that with result = square(3) .

All code should look like this:

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

Hope that will help you :)