1/6
Looks like no tags are added yet.
How to open a file in order to write to it
file = open(“FILE.txt”, “w”)
How to loop over an array with the index [i]
for i in range(len(array)):
print(array[i])
What is the length of a 2D array
The number of rows
How does integer division work?
It rounds down/floors
How do you get the number of columns in a 2D array
numberOfColumns = len(row)
How to loop through every item in a 2D array row by row
for row_i in range(len(array)):
for col_i in range(len(array[row_i])):
print(array[row_i][col_i])
How to loop through every item in a 2D array column by column
for col_i in range(len(array[0])):
for row_i in range(len(array)):
print(array[row_i][col_i])