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 trialrobin saldanha
Python Development Techdegree Student 281 PointsHelp please
feeling like I hit a wall.. why is this not working?
def square(number):
return number*number
result = square("3")
print (result)
3 Answers
Zimri Leijen
11,835 PointsYou're passing it a string "3".
A number is only a number if it doesn't have "
surrounding them.
ThatOneCoder -
9,310 PointsYou're making a string instead of a integer at the 3.
make sure you know that when having a number putting " around it won't make it a number.
robin saldanha
Python Development Techdegree Student 281 Pointsrobin saldanha
Python Development Techdegree Student 281 PointsThanks!