1
2 phrase.find(phrase[::-1])
3
4
5 a, b = b, a
6
7
8 sum(stock_prices[::2])
9
10
11 [line.strip() for line in open(filename)]
12
13
14 reduce(lambda x, y: x * y, range(1, n+1))
15
16
17 python -m cProfile foo.py
18
19
20 lambda l: reduce(lambda z, x: z + [y + [x] for y in z], l, [[]])
21
22
23 lambda x: x if x<=1 else fib(x-1) + fib(x-2)
24
25
26 lambda L: [] if L==[] else qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])
27
28
29 reduce( (lambda r,x: r-set(range(x**2,n,x)) if (x in r) else r), range(2,int(n**0.5)), set(range(2,n)))