Python Fundamentals / Collections
Lesson 21 of 38
Lists
A list holds many values in order, inside square brackets. Positions (indexes) start at 0, and -1 means the last item.
Key points
- Indexes start at 0
- items[-1] is the last item
- Lists can change
tools = ["nmap", "wireshark", "python"]
print(tools[0]) # nmap
print(tools[-1]) # pythonQuiz · +10 XP
What is the index of the first item in a list?
Log in to save progress and earn XP.