Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,520 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.