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

Ruby Ruby Basics (Retired) Ruby Methods Method Returns: Part 2

String interpolation in Ruby

What am I doing wrong? It does not work!

method.rb
def mod(a, b)
  c = a % b
  return The remainder of #{a} divided by #{b} is #{c}.” 
end

I think there was a some kind of bug. Problem was solved!

2 Answers

You 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
Jose Soto
23,407 Points

Double 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}."