Articles
The problem...
You have a list. Ten elements. A hundred. Maybe more.
You don't want to write print(squad[0]), print(squad[1]), print(squad[2])...
You want to do something with …
The problem...
You have three squads. Each squad has its own list of members.
You could create three separate lists:
alpha = ["Raven", "Wolf", "Ghost"]
bravo = ["Viper", "Bull…
What you're building
A shopping list manager that runs in a loop.
The user can add items, remove items, and quit when done.
The list updates and prints after every action.
Wha…
What you're building
A grade book for three subjects: Math, English, Biology.
The user adds grades for each subject. The program calculates and displays the average per subject …
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", …