original_list = [1, 2, 3, 4, 5, 6, 7, 8, 9] sublist = original_list[2:7] print(f"Original List: {original_list}\nSublist: {sublist}")
Output:
Original List: [1, 2, 3, 4, 5, 6, 7, 8, 9]
Sublist: [3, 4, 5, 6, 7]
original_list = [1, 2, 3, 4, 5, 6, 7, 8, 9] sublist = original_list[2:7] print(f"Original List: {original_list}\nSublist: {sublist}")
Output:
Original List: [1, 2, 3, 4, 5, 6, 7, 8, 9]
Sublist: [3, 4, 5, 6, 7]