Ruby - Basics and Runtime
You want to print a nested array in Ruby so that each element is shown with quotes and the entire structure is visible on one line. Which code snippet achieves this?
puts [["1", "2"], ["3", "4"]]print [["1", "2"], ["3", "4"]]p [["1", "2"], ["3", "4"]]p prints the inspect form, showing quotes if strings and the full structure on one line, exactly as the array looks.puts [["1", "2"], ["3", "4"]].to_s15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions