rows = [
[1, 3, 4],
[1, 2, 3, 5, 6],
[1, 3, 5],
[1, 3, 11]
]
res = set(rows[0])
for row in rows[1:]:
res.intersection_update(row)
a = 368
for x in [100, 10, 1]:
print(a // x) # целочисленное деление
a %= x # остаток от деления
from math import log10
a = 1234567890
assert a >= 0, "только для положительных значений"
for x in range(int(log10((a // 10 * 10) or 1)), -1, -1):
x = 10 ** x
print(a // (x))
a %= x