I made a program in Idle that says:
for trial in range(3):
if input('Password:') == 'password':
break
else:
# didn't find password after 3 attempts
**I need a stop program here**
print ("Welcome in")
Remember, this is in Idle, so I need program for Idle, not CMD. I also am using Python 3.2, if that helps.
use
sys.exit()orraise SystemExitEdit:
To end it silently wrap it in a
try-exceptblock: