【发布时间】:2021-03-22 06:32:17
【问题描述】:
我在字符串中列出了我想要的字符并且还知道长度。我只是不知道在哪里宣布角色 我想使用的。`
import random
characters = ("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", ":", ";", "<", "=", ">", "?", "@", "[",
"]", "/", "^", "_", "'")
class Password:
def creat_password(self):
length = float(input("Enter a float between 6 & 12"))
【问题讨论】:
-
SO 上已经有大量关于密码生成的帖子。你搜索过它们并寻求灵感吗?
-
python password generator的 google 的 18.300.000 个结果应该为您提供足够的信息来解决它,如果您还研究了 https://docs.python.org/3/library/random.html,您应该能够看到如何生成随机字母。
标签: python python-3.x random passwords