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 trialChris Drummond
1,315 PointsGreat now that you have created your new square method, let's put it to use. Under the function definition, call your
Great now that you have created your new square method, let's put it to use.
Under the function definition, call your
def square(number):
return number * number
square(3)
2 Answers
Jennifer Nordell
Treehouse TeacherHi there, Chris Drummond! Looks like you're doing great so far. The second part of the task wants you to create a new variable named result
and assign it what is returned by the square
function when it is passed a 3.
You're looking for:
result = square(3)
Hope this helps!
Alana Warson
5,296 PointsYes, I get confused with what gets indented. Thank you for your help!
Regards,
Alana
Alana Warson
5,296 PointsAlana Warson
5,296 PointsHi Jennifer,
My code doesn't work for this challenge.
I am not sure what is wrong.
Regards,
Alana
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherHi, Alana Warson! I added some markdown to your comment so that your code would be clear. The final two lines should not be indented inside the function. Rather, their left sides should line up with
def
Where you have this:
You would need:
Indentation matters! Hope this helps!