Functions part II

variable number arguments

*[1, 2, 3, 4] --> 1, 2, 3, 4,

zip(*[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]])
zip([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 4, 6, 8, 10, 12, 14, 16, 18, 20])

problems

>>> repeat(lambda x: 2*x, 1, 5)
32

twice(twice(twice(twice(twice(1)))))

>>> f = lambda x:2*x
>>> g = lambda x:x*x
>>> fg = compose(f, g)
>>> fg(2) ## f(g(2))
8