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)
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsThe Mod method could not be found
I put in this code but it doesn't seem to work
def mod(a, b)
a % b = c
return "The remainder of #{a} divided by #{b} is #{c}"
end
11 Answers
![Luis Henrique Witz](https://secure.gravatar.com/avatar/f6cd7ec100a8e774d4149469cfffb6b2?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Luis Henrique Witz
16,505 PointsIt should't be?
def mod(a, b)
c = a % b
return "The remainder of #{a} divided by #{b} is #{c}"
end
![alastair cooper](https://uploads.teamtreehouse.com/production/profile-photos/5719542/micro_jakeface_small.jpg)
alastair cooper
30,617 PointsI think it is not compiled because you have % instead of /.
not sure though
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsIm supposed to find the remainder so...
![alastair cooper](https://uploads.teamtreehouse.com/production/profile-photos/5719542/micro_jakeface_small.jpg)
alastair cooper
30,617 Pointssorry... not paying attention
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsWouldn't that be the same thing? Anyways, I'll try it out. Thanks
![Luis Henrique Witz](https://secure.gravatar.com/avatar/f6cd7ec100a8e774d4149469cfffb6b2?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Luis Henrique Witz
16,505 PointsWhat's the error?
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsBummer! The mod method could not be found.
![Luis Henrique Witz](https://secure.gravatar.com/avatar/f6cd7ec100a8e774d4149469cfffb6b2?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Luis Henrique Witz
16,505 PointsWeird. When I run the code in the challenge it passes. You are running locally?
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsLocally?
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsWould you mind posting the code you ran?
![Luis Henrique Witz](https://secure.gravatar.com/avatar/f6cd7ec100a8e774d4149469cfffb6b2?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Luis Henrique Witz
16,505 PointsSure my friend. It's the same that I posted first:
def mod(a, b)
c = a % b
return "The remainder of #{a} divided by #{b} is #{c}"
end
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsAnother Error is: Bummer! NameError: undefined local variable or method `c' for main:Object
With this code:
def mod(a, b)
a % b = c
return "The remainder of #{a} divided by #{b} is #{c}"
end
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 Pointsdef mod(a, b) a % b = c return "The remainder of #{a} divided by #{b} is #{c}" end
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsThat code gives me this error: Bummer! Something doesn't look quite right. Double check your spelling and punctuation.
![Luis Henrique Witz](https://secure.gravatar.com/avatar/f6cd7ec100a8e774d4149469cfffb6b2?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Luis Henrique Witz
16,505 PointsSorry. The challenge need's of the pontuaction at the end :)
def mod(a, b)
c = a % b
return "The remainder of #{a} divided by #{b} is #{c}."
end
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsLets hope that's not what I was stuck on for 3 hours...
![Omar Farag](https://uploads.teamtreehouse.com/production/profile-photos/5909452/micro_Omar_Androidify.jpg)
Omar Farag
4,573 PointsLol. That was what I was stuck on for 3 hours! Thanks man! You really helped me out!
![oluwole oyekanmi](https://secure.gravatar.com/avatar/4f9b3a30296f0d383048ca2c3b8265bf?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
oluwole oyekanmi
286 PointsThanks Luis.. I was stuck on this for two days.. ugh
Omar Farag
4,573 PointsOmar Farag
4,573 PointsNope, doesn't work