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 trialuc
4,309 PointsString interpolation in Ruby
What am I doing wrong? It does not work!
def mod(a, b)
c = a % b
return “The remainder of #{a} divided by #{b} is #{c}.”
end
2 Answers
Alexander Davison
65,469 PointsYou are using a weird symbol: ”
The real symbol you should use to wrap around strings are called double quotes. They look like this: "
I know; they look really similar!
Jose Soto
23,407 PointsDouble check your quotation marks. The first one is not the same as the second one. Try this:
return "The remainder of #{a} divided by #{b} is #{c}."
uc
4,309 Pointsuc
4,309 PointsI think there was a some kind of bug. Problem was solved!