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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![MightyIronElf 14](https://uploads.teamtreehouse.com/production/profile-photos/11714632/micro_Screenshot_20230415-173552_Pinterest.webp)
MightyIronElf 14
1,660 PointsHow to
After writing my results it keeps telling me my math is wrong and I have no idea why.
number = (5)
def square(number):
return number*5
1 Answer
![Travis Alstrand](https://uploads.teamtreehouse.com/production/profile-photos/11658224/micro_travis.jpg)
Travis Alstrand
Data Analysis Techdegree Graduate 49,407 PointsHey there Haley Phares!
Technically, since you've defined your number
variable as 5
the math is currently correct, but it isn't quite setup to work as the instructions want us to. It wants us to return the number we passed in "squared", which means it's the whatever number we pass in multiplied by itself.
So currently, if we instead defined number
as 10
, it will get multiplied by 5
and return 50
instead of 10 squared, which is 100
.
So we need to make sure it's setup to multiply the passed in number by itself
number = 5
def square(number):
return number * number
I hope this makes sense!
MightyIronElf 14
1,660 PointsMightyIronElf 14
1,660 PointsThanks for this! It really helped!<3
Travis Alstrand
Data Analysis Techdegree Graduate 49,407 PointsTravis Alstrand
Data Analysis Techdegree Graduate 49,407 PointsYou're very welcome!![:smiley: :smiley:](https://image-proxy-cdn.teamtreehouse.com/f266e5f075421fb8b3a44f1b8d72534e51ae5854/68747470733a2f2f7374617469632e7465616d74726565686f7573652e636f6d2f696d616765732f656d6f6a692f756e69636f64652f31663630332e706e67)