Sort by

recency

|

541 Discussions

|

  • + 0 comments
    n = int(input())
    
    for i in range(n):
        UID = input()
        if len(UID) == 10 and UID.isalnum() and len(set(UID)) == 10:
            uppercase_count = sum(1 for char in UID if char.isupper())
            number_count = sum(1 for char in UID if char.isdigit())
            if uppercase_count >= 2 and number_count >= 3:
                print('Valid')
            else:
                print('Invalid')
        else:
            print('Invalid')
    
  • + 0 comments

    7226661311

  • + 0 comments

    def checks(x): n = c = 0 y = list(x)

    for i in y:
        if i.isdigit():
            n += 1
        if i.isupper():
            c += 1
        if y.count(i) > 1:
            return False
    
    if n >= 3 and c >= 2:
        return True
    else:
        return False
    

    for _ in range(int(input())): s = input() if len(s) == 10 and s.isalnum() and checks(s): print("Valid") else: print("Invalid")

  • + 0 comments

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

  • + 0 comments
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    inputcases = []
    T = int(input())
    for casesT in range(0,T):
      inputcases.append(input())
      
      
    for A in inputcases:
    
      if(A.isalnum()):
    
        total_count =0                 
        upper_count = 0
        digit_count = 0
        rep_char = False
        
        
        for char in A:
          
          rep_char_nos = 0
          
          if not rep_char:
                 
            for letters in A:
              if(letters == char):
                rep_char_nos+=1
                if rep_char_nos>1:
                  rep_char = True
                  break
       
          total_count+=1
          
          if(char.isupper()):
            upper_count+=1
              
          elif(char.isdigit()):
            digit_count+=1
              
        if(upper_count>1 and digit_count > 2 and total_count ==10 and not rep_char):
          print('Valid')
        else:
          print('Invalid')
    
      else:
         print('Invalid')