Ruby - Beginner - Dividing using 2D Array -
i can't figure out how phone call upon sec piece of 2d array.
array = [['dog',5], ['cat',10]] num = 10 puts num / array[0,1]
array = [['dog',5], ['cat',10]] num = 10 puts num / array[0][1] # 10/5 = 2 puts num / array[1][1] # 10/10 = 1
ruby
No comments:
Post a Comment