You are viewing a single comment's thread. Return to all comments →
With the help of comprehension lists -->
import sys, re N = sys.stdin.read().splitlines()[1:] pattern = r"^[789]\d{9}$" match = ['YES' if re.search(pattern, line) else 'NO' for line in N] for _ in match: print(_)
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 →
With the help of comprehension lists -->