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

methods.rb

Bummer! Make sure you return a nicely formatted string.

method.rb
def mod(a, b)
  #write your code here
end
Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I would prefer to see some "good faith" effort on your part to show us what you've tried that's failing. Try posting the code that you've attempted by using markdown. A link to a "Markdown Cheatsheet" can be found at the bottom of the "Add an answer" section.

In the long run, it will probably be a better learning experience for you if we can pinpoint what you're not understanding. :sparkles:

1 Answer

MICHAEL P
MICHAEL P
5,191 Points

I believe that it would be :

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