python随机生成手机号码


 

直接撸代码

import string
import random
def phone_num():
all_phone_nums=set()
num_start = ['134', '135', '136', '137', '138', '139', '150', '151', '152', '158', '159', '157', '182', '187', '188',
'147', '130', '131', '132', '155', '156', '185', '186', '133', '153', '180', '189']

start = random.choice(num_start)
end = ''.join(random.sample(string.digits,8))
res = start+end+'\n'
return res


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM