jmpark0118 / CODING_TEST_PRACTICE

0 stars 0 forks source link

Practice>Python>Regex and Parsing>Validating phone numbers #99

Open jmpark0118 opened 3 years ago

jmpark0118 commented 3 years ago

image image

출처 : https://www.hackerrank.com/challenges/validating-the-phone-number/problem

jmpark0118 commented 3 years ago

import re

if __name__ == '__main__':
    for _ in range(int(input())):
        find = re.search('^[789]{1}[\d]{9}$', input())
        if find is None:
            print("NO")
        else:
            print("YES")