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 trialDavid Juhan
637 PointsI am not able to solve this can anyone help me
please solve this
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 everyone in musical_groups:
everyone = ", ".join(musical_groups)
print(everyone)
nakalkucing
12,964 PointsGood answer Eldin Guzin!
2 Answers
nakalkucing
12,964 PointsHi David! I ran your code in the challenge and found the following issues:
Firstly, your .join(musical_groups) returns an error.
Secondly, your print statement returns an error.
I'm tackling the second error first. The print statement must be a part of your for loop.
Now for the first issue, (This will be super confusing if I don't change the name of your variable. So I'm changing your variable to everyone2) your goal isn't to join everyone to musical_groups. Instead, each time you loop through musical groups you want to join everyone to everyone:
for everyone in musical_groups:
# ^ Joining everyone...
everyone2 = ", ".join(everyone)
# ^ ...to itself
Hope this helps! :) Let me know if that doesn't fix the errors and I'll try again.
David Juhan
637 PointsThank You, Guys. You Guys are awsome
Eldin Guzin
6,010 PointsEldin Guzin
6,010 Pointsyou looped through the groups, but know you need to loop through each member of the group you just looped.You need to loop through everyone and then add the comma and space. Hope this helps !