from random import choice
def randpass(n=8):
all='qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM'
zhi=''
n=int(input('请输入你想设置的密码位数:'))
for i in range(n):
p = choice(all)
zhi+=p
return zhi
if __name__ == '__main__':
print(randpass())
print(randpass(4))
import shutil
shutil.copy2
python-random-choice函数
猜你喜欢
转载自blog.csdn.net/weixin_45942735/article/details/104132576
今日推荐
周排行