Пример #1
0
def add_note(username):
    n = Notes(username)
    all_notes = n.read_notes()
    if all_notes and MAX_NOTES_PER_USER == len(all_notes):
        print(
            'You have reached the limit. Your oldest note will be deleted to save new.'
        )
        n.delete_old_note(all_notes)

    new_note = take_input('Enter note to save ', 'note')
    if n.create_note(new_note):
        print('Note saved successfully.')
    else:
        print('something went wrong... please try again')