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

Juan Perez
PLUS
Juan Perez
Courses Plus Student 8,944 Points

Quiz not passing. Im stuck.

For some reason the quiz is not passing. I tried this using terminal and I get the string and the correct answer. But, for some reason its giving me an error in the quiz. Can anyone please explain to me what is wrong here.

thanks.

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

mod(7, 9)

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Juan,

Remember the challenges are extremely picky and very strict. There are two things that need a quick fix. While your code is correct in syntax, the challenge wants you to return the sentence, but you used puts. Second, there is a period missing at the end of the sentence. Change/add those and you're good to go.

:) :dizzy:

Juan Perez
Juan Perez
Courses Plus Student 8,944 Points

Jason Anders Thanks alot! I did try return at the beginning but it wasn't passing but I guess it was because of the period!

I appreciate your help! Thanks!