Ruby - Hashes
Identify the error in the following Ruby code snippet:
h = {x: 10, y: 20}
h.each do |k v|
puts "#{k}: #{v}"
endh = {x: 10, y: 20}
h.each do |k v|
puts "#{k}: #{v}"
end|k, v|. Here comma is missing.each do-end is valid, and puts syntax is correct.k and v -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions