We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Validating phone numbers
Validating phone numbers
Sort by
recency
|
487 Discussions
|
Please Login in order to post a comment
Strange to see such a simple challenge following a few that are more complex. I'm used to challenges being increasingly more complex.
n = int(input()) # Read number of test cases
for i in range(n):
HackerRank is a great platform for learning how to craft and apply regular expressions in Python. The experience was both challenging and rewarding. Gurubhai247 create account
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)