def by_three?(num) if num % 3 == 0 puts true else puts false end end
def by_three?(num) if num % 3 == 0 return true else return false end end
For this code I was asked to “Define a
by_three? method that takes a single integer parameter,
number , and returns
true if that number is evenly divisible by three and
false if not”. My main question is why do I have to use return here? Why does puts not work the same?