Sort by

recency

|

548 Discussions

|

  • + 0 comments
    1. import re
      1. def check(uid):
    2. if len(uid)!=len(set(uid)):
    3. return "Invalid"
    4. else:
    5. match = re.match(r'^(?=(?:.[A-Z]){2,})(?=(?:.\d){3,})[A-Za-z0-9]{10}$',uid)
    6. if match:
    7. return "Valid"
    8. else:
    9. return "Invalid"
      1. for i in range(int(input())):
    10. print(check(input()))
  • + 0 comments
    def uid_validator(uid):
    	uid = uid.strip()
    	return (
    		'Valid' if (
    			re.fullmatch(r'^[0-9a-zA-Z]ยจ{10}', uid)
    			and len(re.findall(r'[A-Z], uid) >=2)
    			and len(re.findall(r'[0-9], uid) >= 3)
    			and len(set(uid) == 10
    		) else 'Invalid
    	)
    
  • + 0 comments
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    import re
    def valid_uid(uid):
        if len(uid) !=10:
            return False
        if not uid.isalnum():
            return False
        if len(set(uid))!=10:
            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
    n = int(input())
    for _ in range(n):
        uid = input().strip()
        print("Valid" if valid_uid(uid) else "Invalid")
    
  • + 0 comments

    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')

  • + 0 comments

    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")