Tags: ppc
Rating:
It is Luhn Algorithm. Find a number and send an answer.
```
def checkLuhn(purportedCC=''):
sum = 0
parity = len(purportedCC) % 2
for i, digit in enumerate([int(x) for x in purportedCC]):
if i % 2 == parity:
digit *= 2
if digit > 9:
digit -= 9
sum += digit
return sum % 10 == 0
```