a = [1.0, 2.0, 2.1, 3.0, 3.1, 4.2, 5.1, 7.2, 9.2]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9]
a1 = [2.1, 3.1, 4.2, 7.2]
mapping = dict(zip(a, b))
[mapping[value] for value in a1 if value in mapping]
Как сравнить список в Python?