Created
April 22, 2019 07:56
-
-
Save EuniceMadya/d7a7f9b82e3df9812f3e50616f041ad1 to your computer and use it in GitHub Desktop.
Python array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ar = [[-1 for i in range (5)] for j in range (10)] # this means creating an array with 5 cols and 10 rows | |
| ar[9][4] #this would result in -1, means the 10th row, 5th col, i.e. the right-bottom corner of the array | |
| ar[4][9] | |
| len(ar) #number of rows | |
| len(ar[0]) #number of cols |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment