Jan-23-2017, 07:57 AM
I got:
and
If I want to 2D array access without numpy, how can I solve this?
I know we can do SortedArray2D[i][j], can't we do SortedArray2D[:][j]?
SortedArray2D= [['a', 'b', 'c', 'd', 'e'], ['f', 'g', 'h', 'i', 'j'], ['k', 'l', 'm', 'n', 'o'], ['p', 'q', 'r', 's', 't'], ['u', 'v', 'w', 'x', 'y']]
print(SortedArray2D[:][1])gives
Quote:['f', 'g', 'h', 'i', 'j']
and
print(SortedArray2D[1][:])also gives
Quote:['f', 'g', 'h', 'i', 'j']
If I want to 2D array access without numpy, how can I solve this?
I know we can do SortedArray2D[i][j], can't we do SortedArray2D[:][j]?