Module 1 said all software is built from three ideas: do something, choose between things, repeat things. You have now done the first two in real Python — variables and, in a moment, if. This lesson is the third idea, and the third is the reason software matters at all.
Lists: boxes in a row
A variable holds one thing. A list holds many, in order:
students = ["Amit", "Priya", "Sara"] print(students)
Square brackets around the outside, commas between the items. Our three students from Module 1 are back — except this time you are writing the code, not just reading it.
You can pick out one item by its position:
print(students[0]) print(students[2])
That prints Amit, then Sara. Yes, you read that correctly: the first item is number 0, not number 1.
Why zero? Historical reasons to do with how computers measure distance from the start of a list. Do not fight it — just remember: position 0 is first, and asking for a position that does not exist (like students[10] here) produces an IndexError, which we will meet properly in the debugging lesson.