phone number validation quiz problem | SoloLearn: Learn to code for FREE!


phone number validation quiz problem

test #3 not correct and locked

2/7/2021 10:02:39 AM

Um Yusuf

3 Answers

New Answer


# try: pattern = r"^[189]\d{7}$" # $ symbolize end of string # [ ] regex class expect list of char (no separators)


Post your CODE First Please. We would help then afterwards. Posting link would not let us see what you did, but open our own solution.


import re #your code goes here pattern= r"^[1,8,9]\d{7}" phon=input() if re.match(pattern,phon): print("Valid") else: print("Invalid")