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 trialMichael L
2,482 PointsRuby 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")
def mod (a, b)
puts "Remainder of #{a} divided by #{b}:"
return a % b
end
puts mod (3, 2)
1 Answer
Salman Akram
Courses Plus Student 40,065 PointsHi 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.
Michael L
2,482 PointsMichael L
2,482 PointsThank you very much Salman - feel much better after this unit is now complete! :)
Salman Akram
Courses Plus Student 40,065 PointsSalman Akram
Courses Plus Student 40,065 PointsAwesome, you are welcome! :-)