Given colors = ["red", "green", "blue", "yellow", "purple"], print the last item using negative inde
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Given colors = ["red", "green", "blue", "yellow", "purple"], print the last item using negative indexing. Then change the item at index 1 to "lime" and print the full list.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.