# Playing with Python lists

eddiecoyote

Eddie

Posted on June 29, 2020

# Playing with Python lists

For the #100DaysOfCode I make sure to do something everyday. I went back and reread a chapter on lists and tuples. It seemed straightforward enough the first time. I can comprehend it, but I don't grok it. It's the little things.

At the end of the chapter, it said to “create a list of favorite bands”. So here are some bands...

favorite_bands = ["Concrete Blonde", "Slayer", "Yngwie Malmsteen"]
Enter fullscreen mode Exit fullscreen mode

Simple enough. And I was able to pull one band from that list with a simple print(favorite_bands[2]) bit. I ran a .append() method and all was good.

Then I ran into trouble in printing two lists. The operation and didn't do it, only printing the last variable. Through trial and error I got it to work with a comma. But when I checked the type of obscure, it returned a string, not a list.

Just goes to show, I have a lot to learn.

Pythonista on iPad

💖 💪 🙅 🚩
eddiecoyote
Eddie

Posted on June 29, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Learning Python
javascript Learning Python

November 28, 2024

Calculate savings with Python!
beginners Calculate savings with Python!

November 26, 2024

UV the game-changer package manager
programming UV the game-changer package manager

November 24, 2024

Beginners Guide for Classes
python Beginners Guide for Classes

November 20, 2024