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 trialBinyamin Grobman
9,286 Pointswhat is wrong with the code?
thanks
Steven Parker
231,269 PointsYou might also want to watch this video on code formatting.
2 Answers
Philip Schultz
11,437 PointsHey Akiva, This challenge is asking for two parts. The first part (task 1 of 2) Is asking you to make a function called 'square'. This function will have one parameter called 'number', then it will return the square of that number. see code below.
def square(number):
return number**2
# NOTE: return number**2 - is how you raise to the power of 2. (if you wanted you could just return number * number)
Task 2 of 2, is asking you to simply call the function and to give it the argument of '3', then store the result in a variable called 'result'.
result = square(3)
Binyamin Grobman
9,286 Pointsthank you so much
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherHi there, Akiva Grobman! Unfortunately, you haven't yet shown us your code, so we really have no way to help you. Take a look at the Markdown Cheatsheet at the bottom of the "Add an Answer" box for tips on how to post your code here. I look forward to seeing your code!