Run Program ❯
Python Home
❯
Run Code
Change Orientation
# Creating a list of colors colors = ["red", "green", "blue", "yellow", "purple"] # Accessing elements using negative indexing print(colors[-1]) # Output: purple (last item) print(colors[-2]) # Output: yellow (second last item) print(colors[-5]) # Output: red (first item)