from random import Random
def random_str(randomlength=8):
str=''
chars='AaBbCcDdEeFfGg1234567890'
length=len(chars)-1
random=Random()
for i in range(randomlength):
str+=chars[random.randint(0,length)]
return str
Python生成随机数
最新推荐文章于 2024-09-09 17:55:34 发布