How to access List elements
I'd start by not calling it list
, since that's the name of the constructor for Python's built in list
type.
But once you've renamed it to cities
or something, you'd do:
print(cities[0][0], cities[1][0])
print(cities[0][1], cities[1][1])
It's simple
y = [['vegas','London'],['US','UK']]
for x in y:
for a in x:
print(a)