pwManager icon indicating copy to clipboard operation
pwManager copied to clipboard

Issue in password_manager.py on line 26

Open AyaanSiddiqui opened this issue 3 years ago • 1 comments

Hi. I was also making password manager, and so went through the repository and copied a piece of code from password_manager.py. But found an error in the 'while block' if you choose '3' it runs the function for infinite times. Since it will not check else code . You can try with this:

`def menu(): print('-'*30) print(('-'*13) + 'Menu'+ ('-' *13)) print('1. Print one') print('2. Print two') print('3. Print three') print('Q. Exit') print('-'*30) return input(": ")

choice = menu()

while choice!="Q": if choice=="1": print("choice is one") if choice=="2": print("choice is two") if choice=="3": print("choice is three") else: choice= menu()

exit() ` can be fixed by putting if block again

if choice!="1" or choice!="2" or choice!="3":

AyaanSiddiqui avatar Feb 10 '22 13:02 AyaanSiddiqui

Fixed this bug with PR #22

Get rid of the else-line and unindent choice=menu()

Also good to change if-statement 2 and 3 to elif-statements.

runarmod avatar Apr 15 '22 20:04 runarmod