py 随机生成一个电话号码

# -*- coding: utf-8 -*-
import random

def createPhone():
    prelist=["130", "131", "132", "133", "134", "135", "136", "137", "138", "139",
             "147", "150", "151", "152", "153", "155", "156", "157", "158", "159",
             "186", "187", "188", "189"]
    new_phone = random.choice(prelist) + "".join(random.choice("0123456789")for i in range(8))
    return new_phone

if __name__ == '__main__':
    phone = createPhone()
    print(phone)
上一篇:2021-08-05


下一篇:JSTL标签库遍历