Getting Items by Position
Pick items using their index.
Getting Items by Position is a free Coding for Kids lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Coding for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Finding One Item 🔍
Hello, treasure hunter! 🗺️ A list has many items. But how do we grab just ONE? We use its position (called an index)! 🎯
Counting from Zero 0️⃣
Surprise! Lists count positions starting from 0, not 1! The first item is at position 0. 🤓
fruits = ["apple", "banana", "cherry"]
print(fruits[0])Using Square Brackets 🔲
To grab an item, write the list name and the position in [ ]. fruits[0] is the first one!
fruits = ["apple", "banana", "cherry"]
print(fruits[1])Position 0, 1, 2 🔢
So apple is 0, banana is 1, cherry is 2. Each item has its own number spot! 📍
fruits = ["apple", "banana", "cherry"]
print(fruits[0])
print(fruits[1])
print(fruits[2])The First Item 🥇
Remember: the FIRST item is always at position [0]. That is the start of every list!
pets = ["dog", "cat", "fish"]
print(pets[0])The Last Item 🏁
Cool trick! Use [-1] to grab the LAST item, no matter how long the list is! 🎉
pets = ["dog", "cat", "fish"]
print(pets[-1])Grab the Middle 🎯
You can grab any item by its position. Let us get the middle one!
colors = ["red", "green", "blue"]
print(colors[1])Use It in a Sentence 📝
Let us grab an item and put it into a friendly message!
snacks = ["chips", "candy", "fruit"]
print("I want " + snacks[0] + "!")Numbers Have Positions Too 🔢
Lists of numbers work the same way. Grab any score by its position!
scores = [10, 20, 30]
print(scores[2])Pick a Prize 🎁
Let us pick the second prize from our prize list!
prizes = ["sticker", "toy", "candy"]
print("You won: " + prizes[1])You Found It! 🎉
Amazing! Try grabbing the first item from your own list.
animals = ["lion", "zebra", "panda"]
print(animals[0])Quick Check 🧠
Quiz time! 🎯 In the list ["a", "b", "c"], what is at position [0]?
Recap Time! 🌟
Treasure found! 🎓 Today you learned:
- Lists count from 0
list[0]grabs the first itemlist[-1]grabs the last item- Each item has its own position number
You are an item-finding hero! 🦸
Frequently asked questions
Is the “Getting Items by Position” lesson free?
Yes — the full text of “Getting Items by Position” is free to read here on the web, and the Coding for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Coding for Kids course, upgrade to CoddyKit PRO.
What will I learn in “Getting Items by Position”?
Pick items using their index. You practise Coding for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Coding for Kids?
No prior experience is required. Coding for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Getting Items by Position” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Coding for Kids lesson?
Yes. Every Coding for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What Is a List?
- Getting Items by Position
- Adding and Removing Items
- Looping Through a List