Cant write / inverse. Help whit Data Structures


#1


Data Structures : I don't know how to put the inverse "/".
my_2d_array = [[0, 0, 0, 0], ["rivotas"]]

my_2d_array { |x| puts "#{x}/n" }


undefined method 'my_2d_array' for #


Replace this line with your code. 
my_2d_array = [[0, 0, 0, 0], ["rivotas"]]

my_2d_array { |x| puts "#{x}/n" }


#2

The issue is with the forward slash, /n. The n is a newline character when it is escaped, as in, \n. I don't see why it is needed since puts (put string) appends a newline to output. It can be removed altogether and will still pass.

my_2d_array { |x| puts "#{x}\n" }

or

my_2d_array { |x| puts "#{x}" }

#3

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