Python Python Basics Functions and Looping Create a Function


Having trouble figuring out this square challenge. Receiving message <function square at 0x7f65e2eb7e18>
def square(number):
    return (number * number)

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


1 Answer

36,515 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:
def square(number):
    return number * number

result = square(3)


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