Python challenge | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python challenge

Hello, can anyone help me with Python "Phone Validation" challenge. import re #your code goes here pattern = "^[7,8,9][0-9]{7}" no = input() if re.search(pattern,no) == True : print("Valid") else : print("Invalid")

8th Dec 2020, 6:40 AM
Jai Suri
Jai Suri - avatar
3 Answers
0
Hmm ok inbox me, maybe I can be a help of you.
8th Dec 2020, 6:44 AM
noteve
noteve - avatar
0
Please show us your attempt. We might be able to tell you the mistakes.
8th Dec 2020, 6:46 AM
XXX
XXX - avatar
0
I have solved the question import re #your code goes here pattern = "[7,8,9][0-9]{7}" no = input() if re.match(pattern,no): print("Valid") else : print("Invalid")
8th Dec 2020, 8:43 AM
Jai Suri
Jai Suri - avatar