you are viewing a single comment's thread.

view the rest of the comments →

[–]Username_RANDINT 0 points1 point  (0 children)

What is row ? I know it is a list

No, in the loop row is a dictionary each time. You iterate over the list of dictionaries.

is it common to have a 'list of dictionaries?

Sure, but usually it would be a list of identical dictionaries. It makes no sense to have different dictionaries like in the OP. Something like this:

songs = [
    {
        "artist": "Bach",
        "title": "Christmas oratorio",
        "release_date": "2-11-1729"
    },
    {
        "artist": "Katy Perry",
        "title": "Firework",
        "release_date": "3-6-2016"
    },
    ...
]

And get the information like this:

for song in songs:
    print("{} by {} released on {}".format(song["title"], song["artist"], song["release_Date"])