猫史档案馆


【Python作品分享】密码生成器

用户:天伦之乐Dr-N天伦之乐Dr-N查看:1 回复:3 评论:1 创建时间:2023-02-02T12:56:13


【作品展示】

center_image

 

【作品介绍】

密码生成器

 

【作品源代码】

import random
import string
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'm', 'l', 'n', 'o', 'p,', 'q', 'r', 's', 't', 'u', 'v', 'x', 'y', 'z',
     'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'M', 'L', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

print("欢迎来到密码生成器")
while True:
    a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'm', 'l', 'n', 'o', 'p,', 'q', 'r', 's', 't', 'u', 'v', 'x', 'y', 'z',
         'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'M', 'L', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

    b = random.choice(a)
    x = random.choice(a)
    v = random.choice(a)
    h = random.choice(a)
    g = random.choice(a)
    a = random.choice(a)
    number = str(random.randrange(49,349))
    sq = random.choice(string.punctuation)
    sd = random.choice(string.punctuation)
    sp = random.choice(string.punctuation)
    sh = random.choice(string.punctuation)
    password = b + a + sq + x + sd + h + sp + g + sh
    psdf = b + a + sq + sd + v + h + sp + g + sh + number
    sfg = psdf + password + number
    print(sfg)
    print("----------------------------------------")
    zxc = input("这个密码满意吗? y or n  请输入:   ")
    if zxc == "y":
        break

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
AokenAoken

sofa

点赞0


评论


10cKYouse1f10cKYouse1f

看好你

点赞0


评论


一列拍767的京局SS4B一列拍767的京局SS4B

是不是可以用集合

点赞0


评论