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

Michael L
Michael L
2,482 Points

Ruby methods Mod Challenge Task 1 - not sure what is needed...

Not sure what is needed, tried like 15 different options already to prepare the Mod Method (see the challenge description). Is there any way to get any tips, etc.? I tried typing in the same code into workspaces, and it works, but my answer is not being accepted (+ nothing comes up when I click "preview")

method.rb
def mod (a, b)
  puts "Remainder of #{a} divided by #{b}:"
  return a % b
end
puts mod (3, 2)

1 Answer

Hi Michael,

You need to remove spaces in between mod (a, b) and mod (3, 2)

Should be like this mod(a,b) and mod(3, 2)

def mod(a, b)
  puts "Remainder of #{a} divided by #{b}:"
  return a % b
end
puts mod(3, 2)

Hope that helps, minor mistake. :open_mouth:

Michael L
Michael L
2,482 Points

Thank you very much Salman - feel much better after this unit is now complete! :)

Awesome, you are welcome! :-)