a = [0]

def f(x):
    a[0] += 1
return 2 * x
print([(x, y) for x in range(5) for y in [f(x)] if y != 2])
print('The function was executed %s times' % a[0])
Можно ли добавить предложение where с пониманием списка?