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

Ali Sutcu
Ali Sutcu
1,286 Points

Cant find all words

I have written the right code but treehouse says Cant find all words.. Checked the output and it was: Hello Tungjatjeta Grüßgott Ğ’iтаю dobrý den hyvää päivää ä½ å¥½ 早上好 How can i fix it

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

2 Answers

Russell Sawyer
seal-mask
.a{fill-rule:evenodd;}techdegree
Russell Sawyer
Front End Web Development Techdegree Student 15,705 Points

When you concatenate, (add to values together), strings you just need to add a plus, +, sign. Oh, and don't forget to add the space before the W.

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

The instructions ask you to add "World" to the end of each element in your print statement.

... but don't forget your space between the two words- they will call it incorrect if it's not there!