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

Why it's doesn't work

i run it in the workspace and it works fine and i don't why it doesn't work here

method.rb
def mod(a, b)
  #write your code here
  return "The remainder of #{a} divided by #{b} is #{a % b}" 
end

puts mod(4,5)

1 Answer

Tobias Helmrich
Tobias Helmrich
31,602 Points

Hey Ahmed,

the error message tells you to check your punctuation and that's really the problem. The code is actually perfectly fine, good job! :) However the only thing that's missing is the period in the end. Challenges are really picky about this so take care of every little detail.

You also don't have to output and call the function yourself as this will happen automatically when the challenge is evaluated.

It should look like this then:

def mod(a, b)
  #write your code here
  return "The remainder of #{a} divided by #{b} is #{a % b}." 
end

I hope that helps! :)