Question: answer the question in PYTHON 3. You type a 14-digit credit cards numbers into a web site, but mistype one of the digits or inadvertently
answer the question in PYTHON 3.

You type a 14-digit credit cards numbers into a web site, but mistype one of the digits or inadvertently interchange two adjacent digit. The web site will perform a validation check that always detects the first type of error and nearly always detects the type of error. The validation checks is as follows: 1. Starting with the leftmost digit, double it and then double every other after it. However, if any of the double digits is a two-digit numbers, subtract 9 from it. Then sum these new digits. For instance, if the credit cards numbers is 58667936100244, then the digit considered are 5, 6, 7, 3, 1, 0, 4, their new replacements are 1, 3, 5, 6, 2, 0, 8, and the sum of the replacement is 25. 2. Sum together the remaining seven digit from the credit card numbers. That is, the digits in the odd-numbered positions. With the credit card number above, we obtain 8 + 6 + 9 + 6 + 0 + 2 + 4 = 35. 3. Add together the two sums. If the result is a multiple of 10, then accept the credit card number. Otherwise, reject it. We accept the credit card number above since 25 + 35 = 60, a multiple of 10. Write a program that prompts the user to enter a credit card numbers as an integer. Display whether the numbers is valid or invalid. Design your Program to use following function: # Return true if the card number is valid def is valid (number) Name the source code file "Validation.py" Sample run: Enter a credit card number: 58667936100244 The Number is valid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
