Python Python Basics Functions and Looping Create a Function

jazzy special
jazzy special
1,332 Points

square

Having trouble figuring out this square challenge. Receiving message <function square at 0x7f65e2eb7e18>

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

number = int(input("Give a number to square.    " ))


print(square)

1 Answer

joelearner
joelearner
36,505 Points

Hi Jeffrey,

Your first two lines look good so I'm guessing you're looking for help on part 2 of the challenge. For part 2, the teacher is looking for you to create a new variable to store a value that comes from using the function you created in part 1. The variable will be called "result" but I don't see that in your code. If you create the result variable, your code should look something like this:

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

result = square(3)

Cheers!

jazzy special
jazzy special
1,332 Points

Thanks Joe, That helped a ton and I figured it out!