Python Python Basics Functions and Looping Create a Function

Son Nguyen
Son Nguyen
638 Points

Hello, can someone please tell me what I am doing wrong? Thank you for your help.

squaring.py
def square (number):
    return (number * number)

number = int(5)

result = square(number*number)

print (result)

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 49,922 Points

You built the function in task 1 ok. In task 2 you are to pass in an argument of 3 and store the result in a variable named result. In your code above you are passing in a value of 5*5 = 25. The simplest code to complete task 2 is:

result = square(3)
Son Nguyen
Son Nguyen
638 Points

Hello Kris. Thank you so much for taking the time out to answer my question so quickly.