I am currently working on a project where we have to check password strength and generate a strong password, but In the task of making a way for the program to exit I've hit a block, and am unable to find ways to progress. Ive tried break and sys.exit() but neither seem to work.
I would like to, when they enter [3] then ['yes'], for the program to end, but it just returns to the first question.
I have also attempted the while = True: , but that had even less success.
count = 0
while (count < 1):
while True:
choice = input ("Do you want to: 1) Check a password 2) Generate a Password, or 3) Quit? . [1/2/3]? : ")
if choice in ['1', '2', '3']:
break
if choice == "1":
while True:
checkyes = input ("you want to check a password, correct? [yes/no]")
if checkyes in ['yes', 'no']:
break
elif choice == "2":
while True:
genyes = input ("you want to generate a password, correct? [yes/no]")
if genyes in ['yes', 'no']:
break
else:
while True:
quityes = input ("you want to quit, correct? [yes/no]")
if quityes in ['yes', 'no']:
break
if choice == "yes":
count = count + 1
else:
pass
breakis beforecount = count + 1- that's the problem.