python 随机生成 01 字符串

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_27667379/article/details/78008598
# -*- coding: utf-8 -*-
import random

seed = "01"
sa = []
for i in range(20):
    sa.append(random.choice(seed))
salt = ''.join(sa)
print salt
生成20位字符串

猜你喜欢

转载自blog.csdn.net/qq_27667379/article/details/78008598