How to declare and use nested lists (a list that contain another list) in Python

1 Answer

0 votes
l = [1, 2, [3, 4, 5, 6], 7, 8, 9]

print(l[2])

print(l[0])
print(l[3])

print(l[2][0])


'''
run:

[3, 4, 5, 6]
1
7
3

'''

 



answered Sep 20, 2017 by avibootz
...