1) What do I need to do?
π― Your mission: Pack for the mission
Make 3 lists:
team with 3 hero names β’ scores with 3 numbers β’ inventory with at least 2 gadgets
Print all three.
2) What do I need to know?
A list holds lots of things
A variable holds one thing. A list holds many things, in order!
Lists use square brackets [ ] with commas between items.
Lists can hold strings, numbers, or both. An empty list is just [].
π§° Your toolkit for this mission
Everything you need to know to finish this lesson on your own:
List
One variable that holds many values, in order.
How to write it: Square brackets [ ], items separated by commas.
team = ["Blaze", "Storm", "Zip"]
Lists of numbers
Numbers go in without quotes.
How to write it: [10, 20, 30]
scores = [10, 20, 30]
Printing a list
Shows the whole list with its brackets.
How to write it: print(team)
inventory = ["shield", "rope"] print(inventory)
len()
Counts how many items are in a list.
How to write it: len(team)
print(len(team)) # 3
Think about it
Look at this code. What happens next, and why? Say it in your own words.
things = ["Nova", 10, 1.4]
Watch & explore βΆ
Power-up: A list holds lots of things
See it happen
1 / 3bag = ["Rope", "Map", "Cape"]
A list is one container with several items, separated by commas.
3) Run the code & terminal output
Press βΆ RUN and your program's messages appear here!


Captain Py
Our next adventure is yours to create.
