python package phonenumbers

Solutions on MaxInterview for python package phonenumbers by the best coders in the world

showing results for - "python package phonenumbers"
Monica
08 Nov 2020
1>>> import phonenumbers
2>>> x = phonenumbers.parse("+442083661177", None)
3>>> print(x)
4Country Code: 44 National Number: 2083661177 Leading Zero: False
5>>> type(x)
6<class 'phonenumbers.phonenumber.PhoneNumber'>
7>>> y = phonenumbers.parse("020 8366 1177", "GB")
8>>> print(y)
9Country Code: 44 National Number: 2083661177 Leading Zero: False
10>>> x == y
11True
12>>> z = phonenumbers.parse("00 1 650 253 2222", "GB")  # as dialled from GB, not a GB number
13>>> print(z)
14Country Code: 1 National Number: 6502532222 Leading Zero(s): False
15