I am using phonenumbers in python to figure out the carrier of a number. I keep getting blank output

I am using phonenumbers in Python to figure out the carrier of a number. I keep getting blank output. Here is my code:

import phonenumbers
import phonenumbers.carrier

num_object = None

while num_object is None:
    try:
        num = input("phone number: ")
        num_object = phonenumbers.parse("+1 {}".format(num), region="US")
    except Exception as error:
        print("ERROR: {}".format(error))

carrier = phonenumbers.carrier.name_for_number(num_object, "en")
print(carrier)


from Recent Questions - Stack Overflow https://ift.tt/30l1rPv
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations