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 Python Basics (2015) Logic in Python Loop

Jabari Bellamy
Jabari Bellamy
9,513 Points

How do I write the for loop that goes through all the words in hellos and print each word plus the word "World"?

I have tried different things, but I consider this a relatively simple code challenge, but there's something that I must not be getting because I keep getting the bummer response. I have thought that this would be the correct line of code for this challenge:

for word in hellos: print(word + "World")

I want to know if I am forgetting a line of code anywhere? Any help would be highly appreciated.

loop.py
hellos = [
    "Hello",
    "Tungjatjeta",
    "Grüßgott",
    "Вiтаю",
    "dobrý den",
    "hyvää päivää",
    "你好",
    "早上好"
]
for word in hellos:
    print(word + "World")

1 Answer

Jabari Bellamy
Jabari Bellamy
9,513 Points

Sorry for the long delay mate. I tried what you said by adding the space between the hello and world and it instantly went through. Very much appreciated.