生成随机密码作业

'''print(ord('A'))
print(ord('a'))
print(ord('0'))'''
import random
SecChar = []
for i in range(26):
    SecChar.extend(chr(random.randint(65,90)))
for i in range(26):
    SecChar.extend(chr(random.randint(97,122)))
for i in range(9):
    SecChar.extend(chr(random.randint(48,57)))
print(SecChar)
for i in range(10):
    password = ""
for j in range (8):
    s = random.choice(SecChar)
    password+=s
    print(password)

生成随机密码作业_第1张图片

你可能感兴趣的:(生成随机密码作业)