Run Program ❯
Python Home
❯
Run Code
Change Orientation
# Creating a list of numbers numbers = [10, 20, 30, 40, 50, 60, 70] # Using a range of negative indexes print(numbers[-4:-1]) # Output: [40, 50, 60] # Full range from negative index print(numbers[-5:]) # Output: [30, 40, 50, 60, 70]