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 trialDrew Rollins
694 PointsStuck on for loop challenge in python
I'm not sure what I'm doing wrong here. I get the response "Didn't find all the hello's" here is my code. Thank you!
hellos = [ "Hello {}", "Tungjatjeta", "Grüßgott", "Вiтаю", "dobrý den", "hyvää päivää", "你好", "早上好" ] for the_hellos in hellos: print(the_hellos.format("World"))
2 Answers
Michael Olszewski
2,513 PointsThis work for me:
for s in hellos:
print(s + ' World')
Joel Hilsenrath
1,626 PointsI believe this will yield your desired results:
hellos = [ "Hello", "Tungjatjeta", "Grüßgott", "Вiтаю", "dobrý den", "hyvää päivää", "你好", "早上好" ] for the_hellos in hellos: print("{} {}".format(the_hellos, "World"))
Drew Rollins
694 PointsThank you. That worked!
Daniel Glover
1,782 PointsHow did you come to decide using the_hellos ? I tried so many variations of words and ended up going for a plural (of the already plural-named variable), which was helloss. Felt so wrong, but worked.