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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Alana Warson](https://secure.gravatar.com/avatar/ef92f0d3a0977458c6b371f36b19b079?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alana Warson
5,296 Pointshere is a multi-dimensional list of musical groups. The first dimension is group, the second is group members.
This multidimensional lists was covered in the last portion of videos I watched. Why can't questions and challenged be in the same track of videos that we are currently going over, Therefore, I have no idea of trying to loop through via dimensions and output members. Can I please get help? Is there an easier track besides Python?
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
6 Answers
![Peter Vann](https://uploads.teamtreehouse.com/production/profile-photos/8935412/micro_MaiTaiPeteGravatar.jpg)
Peter Vann
36,426 PointsHi Alana!
Happy Easter (if you're into that sort of thing)!!! (I spent today visiting my Mom!?!)
This whole challenge is just exploring nested/2-dimensional lists (a list of lists).
Also, it helps to understand how the Python join works (which is essentially BACKWARDS from how you would code it in JavaScript).
More info:
https://www.w3schools.com/python/ref_string_join.asp
And then, of course a for/in loop would be a good looping structure.
This passes task 1:
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
for group in musical_groups:
print( ", ".join(group) ) # "group" being a list of members
But now you have to filter the groups and only print the ones with 3 members (Hint: You'll need to add an if statement).
Sidebar: I try to spend equal time on JS, Python, and PHP (and HTML and CSS) - they all have their place!
Lemmeeno if you can figure out task 2.
If not, I'll help you further.
I hope that helps.
Stay safe and happy coding!
![Alana Warson](https://secure.gravatar.com/avatar/ef92f0d3a0977458c6b371f36b19b079?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alana Warson
5,296 PointsAh, Happy Easter too! I celebrate some holidays but usually try to stay away from my dysfunctional family 😁 My first line of code was: for musical groups in musical groups. Thank you for your help again. Have a great day!
![Alana Warson](https://secure.gravatar.com/avatar/ef92f0d3a0977458c6b371f36b19b079?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alana Warson
5,296 PointsOK, I wrote the code you showed and I got an invalid syntax. I went back and copy/paste your code and I still got a syntax error.
![Peter Vann](https://uploads.teamtreehouse.com/production/profile-photos/8935412/micro_MaiTaiPeteGravatar.jpg)
Peter Vann
36,426 PointsHi Alana!
This passed task 1 for me:
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
for group_members in musical_groups:
print( ", ".join(group_members) )
(I changed group to goup_members for clarity.)
At first, it didn't pass because somehow my first line became:
mmusical_groups = [
(Note the mistake: double mm)
(A copy-n-paste error, evidently...)
This passes task 2:
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
for group_members in musical_groups:
if len(group_members) == 3: # filters-out all but the 3-member groups
print( ", ".join(group_members) )
I hope that helps.
Stay safe and happy coding!
![Alana Warson](https://secure.gravatar.com/avatar/ef92f0d3a0977458c6b371f36b19b079?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alana Warson
5,296 PointsOk the funny thing ... I cannot find the track this problem was at.
Alana
![Peter Vann](https://uploads.teamtreehouse.com/production/profile-photos/8935412/micro_MaiTaiPeteGravatar.jpg)
Peter Vann
36,426 PointsHi Alana!
Try here:
https://teamtreehouse.com/library/introducing-lists
I hope that helps.
Stay safe and happy coding!
![Riley Ittidecharchoti](https://uploads.teamtreehouse.com/production/profile-photos/11613631/micro_wangzai_boy.jpg)
Riley Ittidecharchoti
3,195 PointsThanks for this... I almost had it!