Skip to content

Instantly share code, notes, and snippets.

@alexandregama
Created June 10, 2020 15:22
Show Gist options
  • Save alexandregama/4bf71ff9c266204308dc0f6b65bd242d to your computer and use it in GitHub Desktop.
Save alexandregama/4bf71ff9c266204308dc0f6b65bd242d to your computer and use it in GitHub Desktop.
def is_prime_number(item)
return false if item == 1
(2..(item - 1)).each do |number|
if item % number == 0
return false
end
end
return true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment