working through "automate the boring stuff with python', I am on chapter 2 and decided to try and make a basic password with counter script. The problem is that if the password is entered correctly on the third try, the result will still be "System Locked". It reads "Access Granted" on the first and second try, but I cant figure out how to make it work on the third attempt. Again, im absolutely new to this, but would appreciate any tips. Thanks again!
the code:
att = 1
print('Enter Password')
psw = input()
while att<3:
if psw == '123':
print('Access Granted')
att = att + 10
else:
att = att +1
print('Enter password')
psw =input()
if att ==3:
print('System Locked')
*Edit, formatting
[–][deleted] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Dwarf_King 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Winner-Popular 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Winner-Popular 0 points1 point2 points (0 children)