If you need a container to hold a bunch of things, then lists might be the best choice:
a = [1,8,3]
A type
dir([])
from the Python interpreter to see methods that contain support, such as append, pop, reverse, and sort. Lists also support lists and the P itonable interface:
for x in a:
print x
y = [x ** 2 for x in a]
source
share