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

BRUH! im so confused

AHHH help

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"],
]
for band in musical_groups:
    print('{}, '.format(musical_groups)
Jeremy Charles
Jeremy Charles
Courses Plus Student 643 Points

Hi

Don't forget the closing parentheses for your print statement. *

The "for" keyword can be thought of as "for each". You can think of the first line of a for loop as: for each x in thing:.... On each loop the x becomes the sub item of the main item that is being looped over. Example:

for x in "apple": print("x now equals: ", x)

Output: x now equals: a x now equals: p x now equals: p x now equals: l x now equals: e

Therefore you'll want to be working with the sub lists in the musical_groups list, which you have already called: band, in the first line of your for loop. Then you'll just need to: ", ".join(band)

1 Answer

Basically, instead of doing the '.format()' use '.join()' and get rid of the {} brackets. Also don't use the list 'musical groups' you have to use the 'band' var created in the for loop.

for band in musical_groups:
    print(', '.join(band))