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

Oh no! I felt good about my progress, but now I'm stuck. I have no idea if I'm any close on this one at all.

So I'm to actually square an integer, but I'm quite confused on how to do it. I am following directions in according to how I am understanding this, but it's quite clear I am not actually following at all and I could be way off on this.

squaring.py
def square(number):
    print(square.number(5))

3 Answers

Podrig Leoghain
Podrig Leoghain
5,094 Points

I don't see a square function/method in the python.org docs. I remember just using 5 * 5 and getting the correct answer. Hope this helps (although it is strange there isn't a square method tbh)

Thank you for your reply. I just looked up this task on Google and found the original Teamtreehouse help question asked for this and figured it out. I was most definitely way off on this one. Thanks though anyways. Sorry if I wasted your time.

Podrig Leoghain
Podrig Leoghain
5,094 Points

No time was wasted :) I only do this for the glory tbh ;) (p.s. gimme dat best answer!)

So you do this to get people to give you "Best Answer"? lol!

Podrig Leoghain
Podrig Leoghain
5,094 Points

The incentive of learning a little more about a subject by helping, coupled with a little gold star. The second incentive increases the chances of help being given. Feels good to get cake, no?

Um. Huh. Well, I didn't know that being given "Best Answer" helps make it so you can give help more frequently. That is unless I completely misunderstood what you just said. lol!