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
|
548 Discussions
|
Please Login in order to post a comment
why not aceppt this? 1. import re 2. for _ in range(int(input())): 3. isha = input() 4. jinx = set(isha) 5. powder = list(isha) 6. p = r'[a-zA-Z-0-9]{1,}.\d{1,}' 7. match = re.match(p,isha) 8. if len(isha) == 10: 9. if match: 10. if len(powder) > len(jinx): 11. print('Invalid') 12. elif bool(re.match(p,isha)): 13. print('Valid')
for _ in range(int(input())): guid = input() if len(guid) == 10 and guid.isalnum() and sum(c.isupper() for c in guid) >= 2 and sum(c.isdigit() for c in guid) >= 3 and len(guid) == len(set(guid)): print("Valid") else: print("Invalid")