Python Python Basics Functions and Looping Create a Function

Sean Frye
Sean Frye
1,166 Points

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,089 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)

Sean Frye
Sean Frye
1,166 Points

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,089 Points

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

Sean Frye
Sean Frye
1,166 Points

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

Podrig Leoghain
Podrig Leoghain
5,089 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?

Sean Frye
Sean Frye
1,166 Points

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!