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

Georgios Vivilakis
seal-mask
.a{fill-rule:evenodd;}techdegree
Georgios Vivilakis
Python Development Techdegree Student 3,020 Points

squaring cant give me an answer. I'm confused!

def square(number): return (number * number) result = square(25) print(result)

squaring.py
def square(number):
    square = 100
    return (number * number)
result = square(10)
print(result)

1 Answer

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Data Analysis Techdegree Graduate 49,443 Points

Hey Georgios Vivilakis ! :wave:

You're very close here! Your provided code snippet passes the first task in the Challenge, but for the second, notice it's asking to pass the argument of 3 and you're currently passing 10.

We don't need the print() statement either, that can sometimes throw things off in these challenges.

Also, the square variable inside of your function isn't currently being used, so we can remove that.

I hope this helps!

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