I have code from a tutorial that does this:
elements = []
for i in range(0, 6):
print "Adding %d to the list." % i
# append is a function that lists understand
elements.append(i)
for i in elements:
print "Element was: %d" % i
However, if I only want to print from elements[0] to elements[4], how is this achieved?