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

Michael Kaminski
Michael Kaminski
1,419 Points

I'm not sure what I am doing wrong, for I think I am getting the proper output, but it says it's wrong.

I get the proper output from the question, but it says it is still wrong. Maybe I don't know what the question is asking me to do and how it wants the output. Could someone provide what the output should look like? Thanks.

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 hee
for musical_group in musical_groups:
     print(", ".join, musical_group,", ")

1 Answer

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"],
]
# I changed the print line and got the output to work. Since .join is a method of the 
# strings class it needs to have parenthesis around the argument in join
for musical_group in musical_groups:
     print(", ".join(musical_group),", ")

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 ,

This is the output that I got.