You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromtwilio.restimportClientfromtwilio.base.exceptionsimportTwilioRestException# Your Account Sid and Auth Token from twilio.com/user/account# Store them in the environment variables:# "TWILIO_ACCOUNT_SID" and "TWILIO_AUTH_TOKEN"client=Client()
defis_valid_number(number):
try:
response=client.lookups.phone_numbers(number).fetch(type="carrier")
returnTrueexceptTwilioRestExceptionase:
ife.code==20404:
returnFalseelse:
raiseeprint(is_valid_number('19999999999')) # Falseprint(is_valid_number('15108675309')) # True
The text was updated successfully, but these errors were encountered: