Python一个简单的手机号注册后发送验证码的小程序
def send_code(): input_number = input("Input Your Number:") number_len = len(input_number) CN_Mobile = ['134','135','136','137','138','139','150','151','152','157','158','159','182','183','184','187','188','147','178','1705'] CN_union = ['130','131','132','155','156','185','186','145','176','1709'] CN_telecom = ['133','153','180','181','189','177','1700'] if number_len == 11: if input_number[0:3] in CN_Mobile: print("Operator: China Mobile") print("We're sending verification code via text to your phone:{}".format(input_number)) elif input_number[0:3] in CN_union: print("Operator: China Union") print("We're sending verification code via text to your phone:{}".format(input_number)) elif input_number[0:3] in CN_telecom: print("Operator: China Telecom") print("We're sending verification code via text to your phone:{}".format(input_number)) else: print("No such a operator!") else: send_code()send_code()小程序
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

