Run
import phonenumbers # Take phone number in a string phonenumber_string = "+442083661177" # Parse the string to a PhoneNumber object x = phonenumbers.parse(phonenumber_string) # Get country code code = x.country_code print('Country code :', code)
Output