Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- container_position = [1, 1, 2, 3, 4, 1, 5, 6, 5, 7, 7, 8, 9, 1, 10, 11, 10, 12, 13, 14]
- list_1 = [52, 21, 93, 90, 89, 9, 31, 73, 64, 35, 48, 95, 77, 13, 33, 98, 49, 55, 55, 93]
- new_list = []
- for i in range(max(container_position)):
- new_list.append([])
- for i in range(len(container_position)):
- new_list[container_position[i] - 1].append(list_1[i])
- print(new_list)
Advertisement
Add Comment
Please, Sign In to add comment