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 trialGard Sveipe Bahmanyar
1,693 PointsI dont get it. How do i do this
i tried eeryhting. but i cant undetrstand
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 i in range(len(musical_groups)):
for j in range(len(musical_groups[i])):
print(musical_groups[i][j] + ", ", end="")
print()
1 Answer
Megan Amendola
Treehouse TeacherHi, Gard! When I run your code, there's an extra ',' at the end of each line. That might be what's causing the issue.
Looks like this:
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,
Also, take a look at the join function. It probably wants you to use that function here and it will get rid of the issue you're having above and it can shorten your code.