You are viewing a single comment's thread. Return to all comments →
def prime?(num) ((2..num).select {|x| num % x == 0 }).size == 1 ? true : false end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Methods - Introduction
You are viewing a single comment's thread. Return to all comments →