You are viewing a single comment's thread. Return to all comments →
import re def check_uid(uid): if len(uid) != 10: return False if len(set(uid)) != len(uid): return False if not re.match(r'^[a-zA-Z0-9]+$', uid): return False if len(re.findall(r'[A-Z]', uid)) < 2: return False if len(re.findall(r'\d', uid)) < 3: return False return True for _ in range(int(input())): string = input() result = check_uid(string) if result: print('Valid') else: print("Invalid")
Seems like cookies are disabled on this browser, please enable them to open this website
Validating UID
You are viewing a single comment's thread. Return to all comments →