Ruby - Beginner - Dividing using 2D Array -
I do not know how to call on the second part of the 2D array.
array = [[['dog', 5], ['cat', 10]] num = 10 points / array [0,1]
array = [[dog ', 5], [' cat ', 10]] num = 10 puts num / array [0] [1] puts # 10/5 = 2 points / array [1] [1] # 10/10 = 1
Comments
Post a Comment