I am trying to get the carrier of a phone number
I am using phonenumbers in python and keep getting this error
‘str’ object has no attribute ‘country_code’
Here is my code:
import phonenumbers
num = input("phone number")
from phonenumbers import carrier
Carrier = carrier.name_for_number("+1" + num, "en")
print(Carrier)
![The error message]
It seems that name_for_number wants an object, so you would have to parse the input first:
I would suggest you to do something like this: