0
Python phone validator
I canât get past this challenge in the Python learning path. A valid phone begins with 1,8,9 and is 8 characters long. I used this regex in an online editor and this works but Iâm not sure why Python code isnât accepting this for the tests? import re #your code goes here pa = r"^[189][0-9]{7}
quot; str = "92345678" match = re.search(pa, str) if match: print("Valid") else: print("Invalid")3 RĂ©ponses
+ 1
is it there not required to take input?
str = input()
0
thanks for the reply. I assigned the str to input() and that allowed me to pass. thanks!!!!
0
You're welcome..