From: rotfeast@... (Rotfeast) Date: 2002-10-03T22:45:49+09:00 Subject: Re: Printing the Contents of a 2d Array Thanks to everyone who responded. I had a feeling that the problem was something simple like this. I had the same brackets/parentheses issue in Python (lists/tuples), but your explanation cleared this up Bill. Thanks! William Djaja Tjokroaminata wrote in message news:... > Hi, > > That's because you are mixing array and range, which are totally different > objects. I think what you want is > > $a = [[1,2,3],[4,5,6],[7,8,9]] > (0..2).each do |i| # not brackets, but grouping parentheses > (0..2).each do |j| # not brackets, but grouping parentheses > print $a[i][j] > end > print "\n" > end > > 0..2 # => a range > [0..2] # => an array with a single element of Range class > > Regards, > > Bill > ========================================================================= --snip--