## 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.

# Musical Groups help!

Here is a multi-dimensional list of musical groups. The first dimension is group, the second is group members. Can you loop through each group and output the members joined together with a ", " comma space as a separator, please? I am unsure of what does the first dimension here mean, can anyone help me? If so which loop (for/while) should I use right here?

groups.py
```musical_groups = [
["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"],
]
```

Hi Elgene,

Here is the video for multi-dimensional lists. In it you will see which is considered the first dimension.

You can make either kind of loop work here but generally speaking, for loops are better for situations where you know (or at least the loop knows) at the time of entering into the loop how many iterations you will have (i.e., you know the length of the thing you are iterating over at runtime). While loops are better for situations where the number of iterations is indefinite at the time the loop is entered into (e.g., a menu that takes user input - the user decides as he or she is using the menu when the menu will end).

comma = ", "

for group in musical_groups:

```print(comma.join(group))
```

Elgene,

musical_groups is multi-dimensional because it is a list of lists. The first dimension (group) is defined by the outermost brackets ("[ ]"). Then each line surrounded by brackets and comma separated, is the second dimension group members, like ["Ad Rock", "MCA", "Mike D."],

So, the challenge to loop through the groups (first-dimension/list) and output the join action in the members (second-dimension/list). I would use a for loop to loop through a list.