Created
April 28, 2020 07:57
-
-
Save computer-tutor/5a94028b03ebad2a9313094f562f773a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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