Day 10 of 30Logic & Data Structures
📋Lists
🎯 Today's objective
Store many values in one ordered collection.
📖 Key concepts
- Lists hold ordered items: [1, 2, 3]
- Index from 0; negative from end
- .append(), .remove(), len()
- Slicing: nums[1:3]
💻 Try this code
scores = [88, 92, 79, 95]
scores.append(100)
print(scores[0], scores[-1])
print("Average:", sum(scores) / len(scores))👥 Learn it your way
🧒 Young Explorers
A list is a backpack that holds many things in order.
Your task
Make a list of 5 favourite foods; print the first, the last, and the total count.
💼 Professionals
Know list vs tuple, slicing, and comprehensions: [x*2 for x in nums].
Your task
From a list of prices, build a new list of prices after 10% discount using a comprehension.
🤖 AI connection
A dataset is essentially a big list (of rows / examples). Models learn by scanning lists of examples over and over.
✅ Quick check
What is the index of the first item?
0
What does nums[-1] give?
The last item.