def bar(): s = 0 r = [] for i in range(30): s += i r.append(s) return r