HackerRank Python - Validating Credit Card Numbers
You and Fredrick are good friends. Yesterday, Fredrick received credit cards from ABCD Bank. He wants to verify whether his credit card numbers are valid or not. You happen to be great at regex so he is asking for your help!
A valid credit card from ABCD Bank has the following characteristics:
- # Enter your code here. Read input from STDIN. Print output to STDOUT
- import re
- pattern = re.compile(
- for _ in range(int(input().strip())):
- print('Valid' if pattern.search(input().strip()) else 'Invalid')