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 trialDOHOON KIM
7,669 PointsI am not sure what I am doing wrong
def mod(a, b) print a % b end
I am confused as to why this is not the correct solution for getting a remainder of a when divided by b
def mod(a, b)
print a % b
end
1 Answer
Kevin Korte
28,149 PointsIt's asking you to return the remainder, not print it
DOHOON KIM
7,669 PointsTy that fixed it
Kevin Korte
28,149 PointsYou're welcome
Ariel Espinal
5,451 PointsAriel Espinal
5,451 PointsFrom what I understand, the print function is used primarily to print strings on your screen, it does not do any math. However you can print out a VARIABLE* containing math operations.
Or you can use the return function to return a value.