Q2. Credit card numbers follow certain patterns: It must have between 13 and 16 digits, and the number must start with:4

Q2. Credit card numbers follow certain patterns: It must have between 13 and 16 digits,
and the number must start with:4 for Visa cards5 for MasterCard credit cards37 for American Express cards6 for Discover cardsCredit card numbers are generated following this validity check, commonly known as theLuhn check or the Mod 10 check, which can be described as follows (for illustration,consider the card number 4388576018402626)i.Double every second digit from right to left. If doubling of a digit results in a two-digitnumber, add up the two digits to get a single-digit number.4 3 8 8 5 7 6 0 1 8 4 0 2 6 2 66> 2 2 = 4= 2 2 = 44 2 = 81*2 = 26*2 = 12 (1 + 2 = 3)5 2 = 10 (1 + 0 = 1)8 2 = 16 (1 + 6 = 7)4*2 = 8use python​

Leave a Reply