Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
number = input("Enter Phone number: ")
if len(number)==12:
if number[3]=='-' and number[7]=='-':
if(number[:3]+number[4:7]+number[8:]).isdigit():
print('Phone number is valid')
else :
print("Phone number is invalid")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment