li = [1,2,3,4,5,6,7,8,9] print [x**2for x in li] print [x**2for x in li if x>5] printdict([(x,x*10) for x in li]) print [ (x, y) for x inrange(10) if x % 2if x > 3for y inrange(10) if y > 7if y != 8 ] vec=[2,4,6] vec2=[4,3,-9] sq = [vec[i]+vec2[i] for i inrange(len(vec))] print sq print [x*y for x in [1,2,3] for y in [1,2,3]] testList = [1,2,3,4] defmul2(x): return x*2 print [mul2(i) for i in testList]