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

1 Answer

Viraj Deshaval
Viraj Deshaval
4,874 Points

Hi Sean, In your function you are passing arguments as string 'number'. It should be a variable who refer to any integer or floating point number.

What this challenge is asking you to do is 1. create function called square with one parameter int/float value 2. Return the square of the result. So square of number can be performed as below:

a = 3
square = a * a
square
9
3. Refer the code above and create the function.
4. Then call the function by passing argument 3 and assign the returned value to result variable.