Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sort_todo_notes():
- todo_list = []
- while True:
- note = input()
- if note == "End":
- break
- importance, note_text = note.split('-', 1)
- importance = int(importance)
- index = 0
- while index < len(todo_list) and importance > int(todo_list[index].split('-', 1)[0]):
- index += 1
- todo_list.insert(index, f'{importance}-{note_text}')
- result = [note.split('-', 1)[1] for note in todo_list]
- return result
- result = sort_todo_notes()
- print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement