Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Introducing Lists Build an Application Multidimensional Musical Groups

nikel Hayo
nikel Hayo
1,942 Points

I did not understand at all. which ones are group names and which ones are group members?

I did not understand at all. which ones are group names and which ones are group members?

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

3 Answers

Cameron S
Cameron S
20,147 Points

Try thinking of it like this: musical_groups is a list that holds 7 different lists. Each of the 7 lists inside the musical_groups list, contains the names/ members of an unnamed group, like so:

# second dimension lists 
['Ad Rock', 'MCA', 'Mike D.'] . # 1
['John Lennon', 'Paul McCartney', 'Ringo Starr', 'George Harrison'] # 2
['Salt', 'Peppa', 'Spinderella'] # 3
['Rivers Cuomo', 'Patrick Wilson', 'Brian Bell', 'Scott Shriner'] # 4   (Rock on Weezer!)
['Chuck D.', 'Flavor Flav', 'Professor Griff', 'Khari Winn', 'DJ Lord'] # 5
['Axl Rose', 'Slash', 'Duff McKagan', 'Steven Adler'] # 6
['Run', 'DMC', 'Jam Master Jay'] #7

I got this list by iterating over the musical_groups list:

for group in musical_groups:
    print(group)

Hopefully, this helps clarify some of the questions you have and gets you started down the right path. Good luck!

Steven Parker
Steven Parker
216,148 Points

There are no group names in this data. The list "musical_groups" contains other lists, and each of those contain the names of group members.

If you view the organization as two dimensions, "The first dimension is group" but there's no data for each group other than the list of its members.

nikel Hayo
nikel Hayo
1,942 Points

Thanks to both of you.