Как исправить ошибку
if x % 10 == 3:
m *= x
a.append(x)
import math
import itertools
data_for_test = list(range(1, 31))
ALL_MASK_VALS = 10
TRUE_MASK_VALS = 3
MASK_LEN = math.ceil(len(data_for_test)/ALL_MASK_VALS)
mask = (1 if i < TRUE_MASK_VALS else 0 for _ in range(MASK_LEN) for i in range(ALL_MASK_VALS))
result = list(itertools.compress(data_for_test, mask))
>>> result
[1, 2, 3, 11, 12, 13, 21, 22, 23]