• + 0 comments

    Without Regex:

    for i in range(int(input())):
        inp= input()
        
        if len(inp) == 10 and (inp.startswith('7') or inp.startswith('8') or inp.startswith('9')) and inp.isnumeric():
            print("YES")
        else:
            print("NO")