您将如何分配[5, 6, 7]
to的每个元素row
的值并使其row
成为{1=>5, 2=>6, 3=>7}
?
row = {1=>0, 2=>1, 3=>0}
#this following line doesn't work of course
row.values = [5, 6, 7]
#NoMethodError: undefined method `values=' for {1=>0, 2=>1, 3=>0}:Hash
row
#I want: {1=>5, 2=>6, 3=>7}