Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Introducing Lists Build an Application Multidimensional Musical Groups

I don't follow which are the groups and which are the members and what exactly is asked for me to do here.

Seriously don't follow which of these are groups and which are members as some of these look like they could be a name of a band and some are clearly name and a surname of a person.. and they're all just mixed together there.

Therefore probably the task itself is easy, but I'm completely lost as I don't follow these.

groups.py
musical_groups = [
    ["Ad Rock", "MCA", "Mike D."],
    ["John Lennon", "Paul McCartney", "Ringo Starr", "George Harrison"],
    ["Salt", "Peppa", "Spinderella"],
    ["Rivers Cuomo", "Patrick Wilson", "Brian Bell", "Scott Shriner"],
    ["Chuck D.", "Flavor Flav", "Professor Griff", "Khari Winn", "DJ Lord"],
    ["Axl Rose", "Slash", "Duff McKagan", "Steven Adler"],
    ["Run", "DMC", "Jam Master Jay"],
]
# Your code here

1 Answer

Hello Arturs, this exercise is to manage list of 2 dimensions, which is a fancy way to call a list that store lists in its items. If you try to read this list you get two sets of information:

 musical_groups = [
    item1,
    item2,
    item3,
    item.....
]

this represents a normal list that could also be written as

 musical_groups = [item1, item2, item3, item.....]

the catch in this example is that each item is also a list, with its own items inside so to make it more "readable" the main list or the first "dimension" of the list is written vertically (each item in a line) and the other "dimension", which are the items inside the main list's items, are written horizontally as a usual list.

So going back to the exercise, if you read the horizontal lists (second dimention) it seems you are reading names (even do some of them are quite weird XD) and they are "grouped" as items of the first "dimension" or "main list" which implies these are music groups. so if we go back to the code it can be read as follows:

 musical_groups = [
    music_group1,
    music_group2,
    music_group3,
    music_group....
]

and each music group has a group of members so

 musical_groups = [
    [member1, member2, member...],
    [member1, member2, member...],
    [member1, member2, member...],
    [member1, member2, member...],
]

i hope this helps