from read_note import NOTES
def update_note(title, text):
found_title = None
for note_title in NOTES:
if note_title.strip().lower() == title.strip().lower():
found_title = note_title
break
if found_title == None:
return "Такой заметки нет"
print("Было:", NOTES[found_title])
print("Станет:", text)
answer = input("Применить? (да/нет): ")
if answer.strip().lower() != "да":
return "Изменение отклонено"
NOTES[found_title] = text
return "Заметка " + found_title + " изменена"