Loading Lists...

Lesson 2
Python Lists

Learn how to store multiple items in one variable using a Python list. Lists are useful for fruits, game scores, names, shopping items, and much more.

📦

Create Lists

Make a list using square brackets, like ["apple", "banana", "cherry"].

🔢

Use Indexes

Python starts counting at 0, so mylist[0] gets the first item.

🛠️

Change Lists

Replace items, remove items with pop(), and print your final list.

Watch First

Start with the video, then complete the list activities.

List Activities

Practise creating, changing, and using Python lists.

Exercise 1

Here is a list calledmylist in Pyhton which contains three fruits.

mylist = ["apple", "banana", "cherry"]

Now you try and create a lsit of your own so that it contains four cars with "Toyota" in the 2nd index.



Exercise 2

Open the interactive activity and build a list by dragging fruits into the list slots. Watch how the fruit pile changes when you add or remove items.


Open Exercise 2 →

Python Challenge

Create and edit a fruit list using real Python.

Exercise 3: Challenge Tasks
Tip: use mylist[1] = "grapes" and mylist.pop().
Loading Python…

🍎 Task

Write Python code that does all five steps:

  • Create mylist with 5 fruits.
  • Print the first fruit using index 0.
  • Change the second fruit to "grapes".
  • Remove the last fruit using pop().
  • Print the final list.

Example starting list:

mylist = ["apple", "banana", "cherry", "melon", "pear"]

Expected idea: first print should be apple, and the final list should contain grapes as the second fruit.

Python Editor Press Ctrl + Enter to run
Terminal Output Program output and test results
Output will appear here…
The terminal shows your print() output and whether your list challenge passed.

Keep Learning

Move on when your list challenge passes.

🔁
0
Next Lesson

Try for loops and learn how to repeat actions with a list.


For Loops →
🏠
0
Course Page

Go back to the courses page to choose another challenge.


Courses →