random password generator project

import pyinputplus as pyip 
import random
import string

print("Welcome to this random password generator!")
print("Type 'stop' at any time to quit the program!")
ask_range = pyip.inputNum("Please enter how long you want your password to be: ")


while ask_range not in ['stop', 'Stop', 'STOP']:
    result = ''.join(random.choices(string.ascii_uppercase + string.ascii_lowercase + string.digits, k = ask_range))
    print("The password generated for you is: {}".format(result))
    ask_range = pyip.inputNum("Please enter how long you want your password to be:")
AI悦创·推出辅导班啦,包括「Python 语言辅导班、C++辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发」,全部都是一对一教学:一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。QQ、微信在线,随时响应!V:Jiabcdefh
AI悦创 » random password generator project

发表评论