We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Regex and Parsing
- Validating UID
- Discussions
Validating UID
Validating UID
Sort by
recency
|
541 Discussions
|
Please Login in order to post a comment
7226661311
def checks(x): n = c = 0 y = list(x)
for _ in range(int(input())): s = input() if len(s) == 10 and s.isalnum() and checks(s): print("Valid") else: print("Invalid")
Enter your code here. Read input from STDIN. Print output to STDOUT
import re T = int(input()) euid =[] for _ in range(T): id = input().split() euid.extend(id)
for uid in euid: if (len(uid) == 10 and uid.isalnum() and len(re.findall(r'[A-Z]', uid)) >= 2 and len(re.findall(r'\d', uid)) >= 3 and len(set(uid)) == len(uid)): print("Valid") else: print("Invalid")