You are viewing a single comment's thread. Return to all comments →
n=int(input()) for i in range(n): s=input() a='YES' if len(s)!=10 or s[0] not in '789': a="NO" if any(not j.isdigit() for j in s): a="NO" print(a)
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 →
n=int(input()) for i in range(n): s=input() a='YES' if len(s)!=10 or s[0] not in '789': a="NO" if any(not j.isdigit() for j in s): a="NO" print(a)