python密码生成器详解编程语言

python密码生成器,,,,,,,,,,,,,,,,,

from random import randrange, sample 
#定义列表 
password_list = ['z','y','x','w','v','u','t','s','r','q','p','o','n','m','l','k','j','i','h','g','f','e','d','c','b','a', 
                 '0','1','2','3','4','5','6','7','8','9', 
                 '!','@','#','$','%','^','&','*','(',')','_','+','-','=', 
                 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' 
                 ] 
  
leng=15   #定义长度 
password = "".join(sample(password_list, leng)).replace(' ', '') 
print(password)

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/8508.html

(0)
上一篇 2021年7月18日
下一篇 2021年7月18日

相关推荐

发表回复

登录后才能评论