#Imports
import string
import random
import time
digits = string.digits
letters = string.ascii_letters
punctuation =("!\"\<>@#£$%^&*")
PasswordCode = letters+punctuation+digits
PassLenInput = input("How long should the password be?")
PassLenInput = int(PassLenInput)
for i in range(PassLenInput):
print(random.choice(PasswordCode),end="")
我的输出如下
How long should the password be?4
GtRA
我想将这个输出保存到一个名为pass的变量中,然后将该变量保存到一个文本文件中
谢谢
看看这个答案
我优化了导入并将密码写入了一个文件:
相关问题 更多 >
编程相关推荐