import random,tkinter
n=code=''
count=0#计数器
for i in range(5):
add=random.choice([random.randrange(10),chr(random.randrange(65,90)),chr(random.randrange(97,122))])
code+=str(add)
print(" ------------- ")
f=print(" ",code," ")
print(" ------------- ")
while count<3:
yz=str(input("请输入验证码 : "))
if yz==code:
print("登陆成功 !")
break
else:
count+=1
print("输入有误 ^_^ ")
随机验证码登陆(python)
最新推荐文章于 2022-04-13 20:56:43 发布