Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Functions and Looping Create a Function

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

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!

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