You are viewing a single comment's thread. Return to all comments →
import re n = int(input()) pattern = r"^[7-9][0-9]{9}$" for _ in range(n): phoneno = input() if re.match(pattern, str(phoneno)): print("YES") else: 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 →