Заранее большое спасибо

Люк
Код: Выделить всё
my_list = ["yes", "no"]
while True:
password_question: str = input('Do you want to create a new password?, please type yes or no ')
word = password_question
if word.lower() in my_list:
break
else:
print("Sorry, try again")
if password_question == my_list[0]:
print("Great, let's get started!")
text_write = open("passwords.txt", "a")
lst = []
new_password = input("Please enter a new password -> ")
lst.append(new_password)
text_write.write(new_password + '\n')
text_write.close()
print("Okay, your new password is " + new_password)
while True:
password: str = input("Please enter your password -> ")
found: bool = False
with open("passwords.txt", "r") as text_read:
for line in text_read:
if line.rstrip() == password:
print("Great, you are logged in!")
found = True
break
if not found:
print('Incorrect password, try again')
Подробнее здесь: https://stackoverflow.com/questions/745 ... ord-has-be