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)
![Robert Popescu](https://uploads.teamtreehouse.com/production/profile-photos/11655177/micro_Screenshot_20210918-165012_WhatsApp.jpg)
Robert Popescu
1,341 PointsHow do you print only the lists that contain 3 items in a multidimentional list?
How do you only print the lists that contain 3 items in a multidimentional list. This is the list:
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
2 Answers
![Andy McDonald](https://secure.gravatar.com/avatar/2c7a70bb997cb62e77a9341481bf2b27?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Andy McDonald
Python Development Techdegree Graduate 13,801 PointsYou're for sure going to want to incorporate the len function which counts the number of items in the argument passed. I would probably do this with an if statement that once satisfied. After peeping at some of the other answers to this question it jogged my memory that you also need to use the join function.
'conjoining string'.join(arg) len(arg) list.append(arg)
Comment if you need additional hints
![Andy McDonald](https://secure.gravatar.com/avatar/2c7a70bb997cb62e77a9341481bf2b27?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Andy McDonald
Python Development Techdegree Graduate 13,801 PointsYou mean the join method? So first it wants all the group members like so: 'YG, 2chainz, G-Easy' this is all one string. The "joining string" will be the value between each object. You would get YG2ChainzG-Easy without the ", " between them. So you would use the method like ", ".join(arg).
*Spoiler alert*
The "arg" your passing in is the iteration in the for loop. for x in musical_groups: ", ".join(x)
This particular challenge is not super clear on what it wants the output to be but I passed it like so:
for x in musical_groups: var = ", ".join(x) print(var)
![Andy McDonald](https://secure.gravatar.com/avatar/2c7a70bb997cb62e77a9341481bf2b27?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Andy McDonald
Python Development Techdegree Graduate 13,801 Pointsshow some love and vote up if that did it for you.
Robert Popescu
1,341 PointsRobert Popescu
1,341 PointsThe problem with that is that I don't know how to use it in this case, because in eny way I use it I get an error