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

Ivana Bojcic
seal-mask
.a{fill-rule:evenodd;}techdegree
Ivana Bojcic
Python Development Techdegree Student 892 Points

Is this really it?

Python basics, creating a function. I am not sure this is okay, even though the test results are okay. Did I manage to solve this task, really? Teacher's video lessons were much more complicated with code, this seems to be too simple. I'm sceptic.

Task: Great now that you have created your new square method, let's put it to use. Under the function definition, call your new function and pass it the argument 3. Since your square function returns a value, create a new variable named result to store the value from the function call.

My solution:

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

result = square(3)

1 Answer

Steven Parker
Steven Parker
231,269 Points

That's really it — good job! :+1: The challenges are intended to reinforce the lessons and generally won't be terribly complex.

But do be prepared as you progress through the later courses, as they will become more difficult than this one!

And for future questions, make sure your code is properly formatted. Take a look at these videos about Posting a Question, and using Markdown formatting to preserve the code's appearance.