Wednesday, November 20, 2019

nested list in python

a=[10,20,[30,40]]
print(a)
print(a[0])
print(a[1])
print(a[2][0])
print(a[2][1])

output:
[10, 20, [30, 40]]
10
20
30
40

No comments:

Post a Comment

python class topic video