0
Credit Card Validator problem
I'm trying to do the Credit Card Validator code coach but I cannot pass tests 6 and 7. Apparently they are not valid but my code takes them as valid. My code takes the input from the user, reverses it, unpacks it, converts every character to an int and stores all the characters in a list, then it multiplies every second character by 2 and subtracts 9 if the result is greater than 9, and finally it checks if the sum of all numbers modulo 10 is 0 and the length is 16, and if any of them is false it prints "not valid". https://code.sololearn.com/c309c3WABsYn/?ref=app
1 Antwort
+ 3
If input is less than 16 length then your code generates error so that may be problem in your code i guess...