Do you really want to do this in a functional way? It can be much easier to read:
for i in range(1, len(l), 2):
l[i] = l[i] * 2
or you can use a simple list comprehension and assign a slice:
l[1::2] = [x * 2 for x in l[1::2]]
or
l = [x * (2 if i % 2 == 1 else 1) for i, x in enumerate(l)]
source
share