RosettaCodeData/Task/Arrays/Dao/arrays.dao

11 lines
261 B
Plaintext

# use [] to create numeric arrays of int, float, double or complex types:
a = [ 1, 2, 3 ] # a vector
b = [ 1, 2; 3, 4 ] # a 2X2 matrix
# use {} to create normal arrays of any types:
c = { 1, 2, 'abc' }
d = a[1]
e = b[0,1] # first row, second column
f = c[1]