## Instead of building a list with a loop: b = [] for x in a: b.append(10 * x) foo(b) ## you can often build it much more concisely ## with a list comprehension: foo([10 * x for x in a]) ##or, if foo accepts an arbitrarily iterable (which it usually will), ## a generator expression: foo(10 * x for x in a)