首页 > 代码库 > 8位随机密码

8位随机密码

import random

char = ‘‘
str = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789‘
for j in range(10):
  for i in range(8):
    char += str[random.randint(0,61)]
  print("第{}次的随机密码是:{}".format(j+1,char))
  char = ‘‘

 

 

 运行结果:

技术分享

 

8位随机密码