What is wrong with this?


$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)

puts "n must be an interger."unless n== false

puts "n must be grater than 0." if n <= 0

prime_array ||= [] 

prime = Prime.new
for num in (1..n)
return prime_array




please reply i need so much help


Please provide the error you're getting and the number of the exercise.


Hi - Your code is correct, however you need space before the unless command. I have tested it and when there's no space it gives error on both lines, unless and if conditions. Here's it should be:

puts "n must be an integer." unless n.is_a? Integer
puts "n must be greater than 0." if n <= 0

Hope that solves your problem and update us. Thanks