我只是创建了一个密码验证过程。该程序要求用户输入密码;他们有三个尝试。如果他们没有更正,请让他们再试一次。它只是无法正常运行。
如果我输入“Tom”作为密码,它不会进入授予访问权限。此外,在我尝试了两次之后,“尝试三”没有出现。
password = 'Tom'
count = 0
while count <= 3:
Question = input('Please enter the password: try1')
if Question == password:
print('Access granted Pass 1')
break
while count <= 2:
Question = input('That is incorrect, please try again: trytwo')
count += 2
while count <= 1 :
Question = input('That is incorrect, please try again: trythree')
else:
print('Access denied')
count += 1
一只萌萌小番薯
陪伴而非守候
随时随地看视频慕课网APP
相关分类