码迷,mamicode.com
首页 > 其他好文 > 详细

在26个大小写字母(52个),以及9个数字组成的字符列表中, 随机生成10个8位密码.

时间:2019-05-15 00:34:47      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:组成   import   nbsp   app   技术   char   info   image   range   

print(ord(‘A‘))
print(ord(‘a‘))
print(ord(‘0‘))
import random
SecChar=[]
for i in range(26):
SecChar.append(chr(i+ord(‘A‘)));
for i in range(26):
SecChar.append(chr(i+ord(‘a‘)));
for i in range(9):
SecChar.append(chr(i+ord(‘0‘)));
print(SecChar)
for i in range(10):
password=""
for j in range(8):
s=int(random.randint(1,60))
password+=SecChar[s]
print(password)

技术图片

 

65
97
48
[‘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‘, ‘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‘, ‘0‘, ‘1‘, ‘2‘, ‘3‘, ‘4‘, ‘5‘, ‘6‘, ‘7‘, ‘8‘]
l2TIiY0F
CtmmRnVi
Gb0QaJdU
04h3GoZm
2FTUvprN
gsV8ZR60
GEiw42I7
vHKiWuIu
WpylOZzn
z3Biuaq7

在26个大小写字母(52个),以及9个数字组成的字符列表中, 随机生成10个8位密码.

标签:组成   import   nbsp   app   技术   char   info   image   range   

原文地址:https://www.cnblogs.com/qianlanbaba/p/10865388.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!