Articles
The problem...
You have five soldiers. Each one has a name.
You could store them like this:
soldier1 = "Raven"
soldier2 = "Wolf"
soldier3 = "Ghost"
soldier4 = "Viper"
soldi…
The problem...
You know what a list is. One variable, multiple values.
But knowing the concept isn't the same as knowing how to build one.
There are several ways to create a li…
The problem...
You have a string. One long piece of text.
But the data inside it isn't one thing — it's many things stuck together.
line = "Raven Wolf Ghost Viper Bull"
…
The problem...
You have a list. Five names, ten scores, a hundred values.
But you don't always need the whole thing.
You need one element. Or a few. Or everything from position…
The problem...
You have a list. But it's not final.
You need to add something. Remove something. Sort it. Flip it around.
Lists in Python aren't frozen — you can change t…
The problem...
You have a list. But you don't always know what's in it.
Is a specific value there? Where exactly is it? How many times does it appear? How long is the list?
You…