标签:except dig port try let 技术 inpu div string
import random import string print("欢迎使用密码生成器") def passlength(): print("你想要多长的密码:") global passlen try: input1=input() passlen=int(input1) except: print("请输入一个数字") passlength() if passlen<5: print("太短了??") passlength() elif passlen>30: print("太长了??") passlength() else: print("好的??") passlength() def passwordgen(): chars=string.ascii_letters+string.digits+"@$*!?/" password="" for x in range(passlen): password=password+random.choice(chars) print("你的密码是:"+password) passwordgen()
标签:except dig port try let 技术 inpu div string
原文地址:https://www.cnblogs.com/HGNET/p/12120610.html