You've been adding to lists. This is the other direction, in the browser with nothing to install.
fruits.remove("banana") takes an item out by what it is, not where it is — you say banana, not position two. Printing the list before and after shows what append never has to deal with: cherry, kiwi and mango all shift along one place to close the gap, and the list gets shorter. That's the real difference between the two methods — append only ever makes a list longer with nothing else moving, remove makes it shorter and moves everything after the gap. This is module 8 of the Year 10 course, and it also flags, without demonstrating, why removing items while looping over a list is worth being careful about later.
Timestamps
00:00 - Adding to lists, and now the opposite
00:12 - Labelling the "before" print
00:17 - Removing an item with .remove()
00:26 - By value, not by position
00:38 - Printing "after" to compare
00:41 - Running it
00:43 - Everything after the gap shifts along
00:59 - append vs remove, side by side
01:11 - Why removing while you loop is risky
01:25 - Recap and what's next
Teachers — it's real Python running in the browser, so there's nothing to install on school laptops and no IT ticket to raise.
Open a new tab, go to pythonclassroom.io, and try removing the first item instead of the middle one.
Start coding: pythonclassroom.io
#Python #LearnToCode #PythonForBeginners #CodingForKids #EdTech