def calculate(liste):
my_sum = 0
for n in liste:
val = n * 2
if val >= 10:
x, y = str(val)
my_sum += (int(x) + int(y))
else:
my_sum += val
return my_sum
def is_valid(number):
result = 0
result += calculate(map(int, number[1::2]))
result += sum(map(int, number[0::2]))
return result%10==0
print(is_valid("972487086"))