For loop - Understanding what happens inside the loop,Python-3.x -
i have question, read online still not understood.
i have next loop , know how works in detail.
matrix = [[]] counter = 0 row = 5 col = 3 matrix = [[counter in range(row)] j in range(col)] row in matrix: elem in row: print(elem, end=' ') print() this first line in loop>>> "for row in matrix:" >>> talking how many row have second line >>> "for elem in row:" talking how many elements in row use of variable "col"?
i understand how loop works in java or c++, here not understand completely, happy explain
thank you.
in second loop iterate on elements in row excatly iterate on columns.
Comments
Post a Comment