Created
June 2, 2022 08:10
-
-
Save justxor/a7aa191f0fac058b5702651639af6a10 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
>>> import phonenumbers | |
>>> x = phonenumbers.parse("+442083661177", None) | |
>>> print(x) | |
Country Code: 44 National Number: 2083661177 Leading Zero: False | |
>>> type(x) | |
<class 'phonenumbers.phonenumber.PhoneNumber'> | |
>>> y = phonenumbers.parse("020 8366 1177", "GB") | |
>>> print(y) | |
Country Code: 44 National Number: 2083661177 Leading Zero: False | |
>>> x == y | |
True | |
>>> z = phonenumbers.parse("00 1 650 253 2222", "GB") # as dialled from GB, not a GB number | |
>>> print(z) | |
Country Code: 1 National Number: 6502532222 Leading Zero(s): False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment