l = []l = [x for x inrange(10)if x%2==0]l.append(1)l.extend([1,2,3])l.remove(2)del l[0]l.pop()#remove and return
Unhashable so can't be keys/in set, but tuples can be...
Iterate
for v in l:for reverseV inreversed(l):#reversed returns iterator for i inrange(len(l)):for x inrange(len(s) -1, -1, -1):#reversed is more clearfor reverseI inreversed(range(len(l))):for i, v inenumerate(l):
Helpers
l.reverse()reversed(l)#returns an iterator over copyOfL = l[:]