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 trialLia Lee
Courses Plus Student 1,030 PointsHow do i use string interpolation to place the "return" inside a sentence that under a new variable "c"?
I am stuck on this quiz question. Not sure what the proper syntax would be.
7 Answers
David Abel
5,199 PointsFull answer should look like this:
def mod(a,b)
c = a%b
return "The remainder of #{a} divided by #{b} is #{c}."
end
David Abel
5,199 PointsDefine "c" then your return statement.
c = a%b
return "The remainder of #{a} divided by #{b} is #{c}."
Lia Lee
Courses Plus Student 1,030 PointsI tried that. Let me refresh the browser and try again.
Lia Lee
Courses Plus Student 1,030 PointsI get this error:
Bummer! Something doesn't look quite right. Double check your spelling and punctuation.
Lia Lee
Courses Plus Student 1,030 PointsNow says: Bummer! The 'mod' method should take 2 arguments
ahhhh! This is frustrating...do you think there is a bug in the module?
David Abel
5,199 PointsLia, My bad! I forgot to add the (a,b) to the def mod line. Try it now!
Lia Lee
Courses Plus Student 1,030 PointsThank you so much!! That worked, I will study the syntax to see what I was missing. Thank you again!
Lia Lee
Courses Plus Student 1,030 PointsLia Lee
Courses Plus Student 1,030 PointsI meant to say "place the "return" value inside of a sentence, and under a new variable "c"?" Not "that".