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 trialMacKenzie T. Stout
23,972 PointsCannot concatenate "str" to list?
Am receiving this bummer, "can only concatenate list (not "str") to list"
hellos = [
"Hello",
"Tungjatjeta",
"Grüßgott",
"Вiтаю",
"dobrý den",
"hyvää päivää",
"你好",
"早上好"
]
for hello in hellos:
print(hellos + " World")
1 Answer
Jennifer Nordell
Treehouse TeacherClose doesn't begin to describe it. I don't think you can get any closer without actually getting it right!
Take a look:
for hello in hellos:
print(hello + " World")
You've said to print hellos... Keep in mind that hellos is the entire list of strings. The variable hello holds one single greeting from that list which is what we're after
MacKenzie T. Stout
23,972 PointsMacKenzie T. Stout
23,972 PointsI thought I understood it, couldn't figure out what I was doing wrong, thank you!!
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherMacKenzie Stout You're quite welcome! But to be fair, you could've understood it perfectly and the typo monster got you. Happens to me a lot!