#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author simpelzhuo
import random
class PhoneNOGenerator():
# 随机生成手机号码
def phoneNORandomGenerator(self):
prelist=["130","131","132","133","134","135","136","137","138","139","147","150","151","152","153","155","156","157","158","159","186","187","188"]
return random.choice(prelist)+"".join(random.choice("0123456789") for i in range(8))
if __name__ == ‘__main__‘:
pg = PhoneNOGenerator()
print(pg.phoneNORandomGenerator())
相关文章
- 01-17random 模块 python 生成大写字母,小写字母及数字的5位随机数
- 01-17python---生成随机密码
- 01-17python随机图片验证码的生成
- 01-17Python入门 - 生成随机数
- 01-17【python】【转】Python生成随机数的方法
- 01-17Python random() 生成随机数
- 01-17Python生成随机数的方法
- 01-17Python - 生成随机验证码的3种实现方式
- 01-17selenium + python自动化测试unittest框架学习(七)随机生成姓名
- 01-17Python 脚本生成测试数据,Python生成随机数据,Python生成大量数据保存到文件夹中