Kids Coding

Lists of Things

A list holds many items in order. Add, read, and loop through them.

KidsIntermediateLists of Things

Many things in one box

A list holds items in order, inside square brackets, separated by commas.

A list of pets

pets = ["cat", "dog", "fox"]
print(pets)
print(pets[0])
print(pets[2])

The first item is index 0. pets[0] is cat. Counting from zero feels odd once, then it is normal.

Loop through a list

Say hello to each

pets = ["cat", "dog", "fox"]
for pet in pets:
    print("Hello, " + pet)

Add an item

append

pets = ["cat", "dog"]
pets.append("fox")
print(pets)
print("Count:", len(pets))

Real life

A backpack before school.

Many items, one bag. A list is the bag. Index 0 is the first thing you packed.

Backpack

bag = ["book", "lunch", "water"]
print("First in:", bag[0])
bag.append("hoodie")
print("Packed:", len(bag), "things")
for item in bag:
    print("-", item)

Change one word. Run it. That is how this idea shows up outside the lesson.

Try it

Exercise 1: Make a list of three foods. Print the second food (index 1).

Show solution
foods = ["rice", "noodles", "bread"]
print(foods[1])

FAQ: Lists of Things

Common questions about this page.

What is StudyGrid Kids?

StudyGrid Kids is a free coding path for children: Basic, Intermediate, and Advanced. Lessons use Python in the browser. No account and no install.

Should I run lists of things examples locally for better learning?

Yes. Use the browser editor on StudyGrid for a quick check, then Download the example and run it on your computer. Local runs show real errors and the real toolchain, which is one of the fastest ways to learn lists of things in this Kids Coding Python lesson (Lists of Things).

Which kids level should we start with?

Start at Basic if the child has never written code. Choose Intermediate if they can print, use variables, and write a simple if. Choose Advanced if they already use loops and lists.

Do kids need an account or an app?

No. Kids pages are public. Code runs in the Try Python editor at /try. We do not ask children for a name or an email.

What language do kids learn?

Python, with a first HTML page in Intermediate and Advanced. After Advanced, the main Python tutorial is the next step.

Is the kids coding track free?

Yes. The Kids home, the three levels, and the Python editor on StudyGrid (studygrid.in) are free.