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

loopy python

I have an error "all hello's can not be found" , Why? , Could somebody help me?

loop.py
hellos = [
    "Hello",
    "Tungjatjeta",
    "Grüßgott",
    "Вiтаю",
    "dobrý den",
    "hyvää päivää",
    "你好",
    "早上好"
]

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

2 Answers

Vidhya Sagar
Vidhya Sagar
1,568 Points

You just have to put a space inside the quotes of world .Sometimes these challenges are quite taxing and strict .Hope this helps.Happy Coding.

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

thank you :) It work well

andren
andren
28,558 Points

The loop itself is fine, the issue is with the spacing in your print statement. If you ran the code you have written the result would be:

HelloWorld
TungjatjetaWorld
GrüßgottWorld
etc...

As you can see it is not spaced properly, that is because of the fact that when you concationate two string together they are merged together without any spacing being added, so if you want proper spacing you have to it on on your own manually. The easiest way of doing this is to add a space at the start of the "world" string like this:

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

Changing your loop to look like that will allow you to complete the challenge.