Lint fixes: false -> False, missing imports, Index list, not map iter

Change-Id: Iff4123a49c8dbcfc405612c0663d5c7d0f549748
This commit is contained in:
Daniel Willmann
2020-10-19 10:35:11 +02:00
parent 677d41bb41
commit dd014ea306
3 changed files with 5 additions and 5 deletions

View File

@@ -249,7 +249,7 @@ def calculate_luhn(cc):
"""
Calculate Luhn checksum used in e.g. ICCID and IMEI
"""
num = map(int, str(cc))
num = list(map(int, str(cc)))
check_digit = 10 - sum(num[-2::-2] + [sum(divmod(d * 2, 10)) for d in num[::-2]]) % 10
return 0 if check_digit == 10 else check_digit