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 trial925 prod
421 PointsCreate a function named square. It should define a single parameter named number. In the body of the function, return
Create a function named square. It should define a single parameter named number.
In the body of the function, return
def square(number):
number = input
Value = number * number
return value
2 Answers
Chris Freeman
Treehouse Moderator 68,441 PointsYou are on the right track. There is no need to use input
with functions. They get their input from the arguments passed into their parameters in the signature. You'll see these terms used a lot.
The variable value
should be lowercased to match the parameter name value
.
Post back if you need more help. Good Luck!!
925 prod
421 Points[redacted]
value = number * number
[MOD: redacted]
Chris Freeman
Treehouse Moderator 68,441 PointsHi 925 prod, we discourage posting of cut and paste answers in the forum. I have redacted part of your answer.