You are viewing a single comment's thread. Return to all comments →
Solving without regex:
n = int(input()) for _ in range(n): j = input() try: arr = list(map(int, list(j))) if arr[0] in (7,8,9) and len(arr) == 10: print ("YES") else: print("NO") except ValueError: print("NO")
Seems like cookies are disabled on this browser, please enable them to open this website
Validating phone numbers
You are viewing a single comment's thread. Return to all comments →
Solving without regex: