🧾 Python 1D Lists — DevOps Track

Interactive lesson · live visualisation · quizzes

Creating Lists Literal

Pick a creation style — the code below updates live, and you can ▶ play the build to watch each element appear.



    

Visualisation

Each element pops in as the list grows.

elements built
0
len(list)
0

Indexing in a List


    
⚠️ fruits[100] raises IndexError — index must be within bounds.

Visualisation

Click any box · pointer flies to your pick · indices shown above/below.

Iteration step 0 / 0



    
i
name

Membership check

Watch it iterate

Current element is highlighted with a bouncing pointer.

Live Code len = 5

Every click below updates this code AND animates the list. Undo if you regret something!


    

Current list

len(li)
5
last action

Methods Playground

🟢 Add items

🔵 Remove items

🟡 Query & reorder

🔴 Wipe out

Gotcha: a = b doesn't copy — both names point to the same list. Use b = a.copy() or b = a[:].

Live Code

Edit a and b on the right. Press ▶ Merge to watch items fly into c.


    
+ creates a new list c. Both a and b stay exactly the same — nothing is mutated.
len(a)
0
len(b)
0
len(c)
0

Concatenation Visualiser

🔵 a

🟣 b

🟢 c = a + b