Python 随机生成手机号码

import random


def random_mobile_phone():
    firsts = ['133', '153', '180', '181', '189', '177', '173', '149', '130', '131', '132', '155', '156', '145', '185',
              '186', '176', '134', '135', '136', '137', '138', '139', '150', '151', '152', '158', '159', '182', '183',
              '184', '157', '187', '188', '147', '178', '184']
    phone = random.choice(firsts) + ''.join(random.sample('0123456789', 8))
    return phone

print(random_mobile_phone())