Sort by

recency

|

474 Discussions

|

  • + 0 comments
    import re
    for _ in range(int(input())):
        print('YES' if re.match(r'^[789]\d{9}$', input()) else 'NO')
    
  • + 0 comments
    import re
    check = re.compile(r'^[789]\d{9}$')
    N = int(input())
    while N > 0:
        N -= 1
        print('YES' if check.match(input()) else 'NO')
    
  • + 0 comments
    import re
    
    N = int(input())  
    
    for _ in range(N):
        cell_number = input().strip() 
        if re.match(r'^[789]\d{9}$', cell_number):  
            print('YES')
        else:
            print('NO')
    
  • + 0 comments
    import re
    
    pattern = r"^[7-9]\d{9}$"
    N = int(input())
    mobile_no = []
    
    if 1 <= N <= 10:
        for n in range(N):
            user_input = input()
            mobile_no.append(user_input)
    
    for no in mobile_no:
            if re.match(pattern, no) and 2 <= len(no) <= 10:
                    print('YES')
            else:
                    print("NO")
    
  • + 0 comments
    import re
    N=int(input())
    for i in range(N):
        num=input()
        if len(num)<10:
            print('NO')
        else:
            pattern=r"^[789][0-9]{9}$"
            if bool(re.match(pattern,num))==True:
                print('YES')
            else:
                print('NO')