- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2DList_NestedLoops.py
More file actions
Latest commit
28 lines (20 loc) · 513 Bytes
/
Copy path2DList_NestedLoops.py
File metadata and controls
28 lines (20 loc) · 513 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#2D Lists
number_lists= [
[1,2,3],
[4,5,6],
[7,8,9],
[0]
]
print(number_lists[1][1])
print(len(number_lists))
print(len(number_lists[1]))
#Nested For Loops
print("Printing the elements line by line of 2D List: ")
forindex_rowinrange(len(number_lists)):
forindex_columninrange(len(number_lists[index_row])):
print(number_lists[index_row][index_column])
#OR:
# for row in number_lists:
# for col in row:
# print(col)
print("This is the end of the 2D Nested List")