随机生成由大小写字母及数字构成的8位密码
import random
def pwd():
all_char = '0123456789qazwsxedcrfvtgbyhnujmikolpQAZWSXEDCRFVTGBYHNUJIKOLP'
index = len(all_char) + 1
passward = ''
for _ in range (8):
n=random.randint(0,index)
passward += all_char[n]
return passward
print(pwd())