You are viewing a single comment's thread. Return to all comments →
My solution for Python 3:
import re N = int(input()) regex_pat = r'^[A-Z]{5}[\d]{4}[A-Z]{1}$' for _ in range(N): line = input() matched_pan = re.search(regex_pat, line) if bool(matched_pan): print("YES") else: print("NO")
Seems like cookies are disabled on this browser, please enable them to open this website
Valid PAN format
You are viewing a single comment's thread. Return to all comments →
My solution for Python 3: