More or less


i ma stuck in the lesson “less is more”. also i can,t understand the overall code. would you please explain this? and whats wrong with my code?? Its not working.

$VERBOSE = nil # We’ll explain this at the end of the lesson.
require ‘prime’ # This is a module. We’ll cover these soon!

def first_n_primes(n)

return “n must be an integer.” unless n.is_a? Integer
return “n must be greater than 0.” if n <= 0

prime_array ||= []

prime =
for num in (1…n)


Its says:
You might have picked the wrong ‘return’! You need the first two, but not the last one.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.