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

Son Nguyen
Son Nguyen
638 Points

Hello, can someone please tell me what I am doing wrong? Thank you for your help.

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

number = int(5)

result = square(number*number)

print (result)

1 Answer

You built the function in task 1 ok. In task 2 you are to pass in an argument of 3 and store the result in a variable named result. In your code above you are passing in a value of 5*5 = 25. The simplest code to complete task 2 is:

result = square(3)
Son Nguyen
Son Nguyen
638 Points

Hello Kris. Thank you so much for taking the time out to answer my question so quickly.