Ruby - Basics and Runtime
You want to print an array in Ruby so that the output shows quotes around strings. Which method should you use?
p array outputs the array using inspect, showing quotes and the array structure on one line; puts array prints each element on a new line but without quotes; print array prints array without newline or quotes; puts array.join(', ') prints elements joined by comma without quotes.p array shows quotes around strings.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions