Advertisement
go6odn28

to-do-list...

Feb 11th, 2024
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. command = input()
  2. my_list = []
  3. my_new_list = [0] * 10
  4. while command != 'End':
  5.     my_list.append(command)
  6.  
  7.     command = input()
  8. sorted_list = sorted(my_list)
  9.  
  10. for current in sorted_list:
  11.     current_string_parts = current.split('-')
  12.     my_new_list.insert(int(current_string_parts[0]) - 1, (current_string_parts[1]))
  13.  
  14. final_list = [note for note in my_new_list if note != 0]
  15. print(final_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement