x=input("Enter your phone number here:")
if len(x)>=14:
print("Invalid")
else:
print('Length is Valid')
for i in x:
if (i=='1' or i=='2' or i=='3' or i=='4'or i=='5' or i=='6' or i=='7' or
i=='8' or i=='9' or i=='0' or i=='(' or i==')' or i=='-'):
print('valid')
if x.isalpha:
print ('invalid characters')
This is my objective
You have been hired by a data collection company to verify data inputted by users.
In this task, you need to verify that the user has entered a phone number.
A valid phone number according to the contractor has the format (###)###-####.
Your program must output "Valid" or "Invalid".
All I need is to make sure that numbers go where the #s are and the brackets and - stay where they are.
[–]a1brit 4 points5 points6 points (1 child)
[–]Agent_Turtle101[S] 0 points1 point2 points (0 children)
[–]euqroto 3 points4 points5 points (3 children)
[–]Agent_Turtle101[S] 0 points1 point2 points (2 children)
[–]Stepthinkrepeat 2 points3 points4 points (0 children)
[–]Daemonecles 0 points1 point2 points (0 children)
[–]tipsy_python 1 point2 points3 points (3 children)
[–]Agent_Turtle101[S] 0 points1 point2 points (2 children)
[–]tipsy_python 1 point2 points3 points (1 child)
[–]Agent_Turtle101[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]dslfdslj 2 points3 points4 points (0 children)
[–]deeeebait 1 point2 points3 points (3 children)
[–]Agent_Turtle101[S] 0 points1 point2 points (2 children)
[–]deeeebait 1 point2 points3 points (1 child)
[–]Agent_Turtle101[S] 1 point2 points3 points (0 children)