Articles
What you're building
A program that takes 6 numbers from the user, stores them in a list, and returns a new list with only the even ones.
The filtering happens inside a function…
You've covered a lot of ground with lists. Here are the mistakes that show up most often — and how to fix them.
1. Capturing None from a mutating method
squad = ["Raven", …
You've covered lists from every angle. Before moving on, here's everything in one place.
// Creating lists
["a", "b", "c"] # literal — values known upfront
[] …
A list is just a list. Until you know what to do with it.
append() until it's full. pop() when you're done with something. sort() when order matters. copy() before you break the …
The problem...
You have a list of soldiers and a list of scores.
names = ["Raven", "Wolf", "Ghost"]
scores = [85, 74, 91]
To find Wolf's score, you need to know Wolf is at in…
The problem...
You know what a dict is. Key, value, instant lookup.
But there's more than one way to build one — and each fits a different situation.
Knowing which to rea…