查询手机号码归属地

import requests
while True:
    phone=int(input('请输入您要查询的手机号码:'))
    url='http://apis.juhe.cn/mobile/get?phone=%d&key=89baea64806cf2020fed945e44a65dd2'%phone
    response=requests.get(url)
    result=response.json()
    data=result['result']
    province=data['province']
    city=data['city']
    company=data['company']
    print('您手机号码的归属地是:%s  %s  %s'%(province,city,company))
    select=input('回车继续输入,按q退出查询:')
    if select=='q':
        print('欢迎下次继续使用')
        break

猜你喜欢

转载自blog.csdn.net/qq_42630844/article/details/81007562