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

Grayson Jones
Grayson Jones
550 Points

Can't find all the hellos

Can't find all the hellos. Should I be using a different variable word in the first line, or am I missing something?

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

2 Answers

Jon Wood
Jon Wood
9,884 Points

I think the challenge wants to print out each word in the the loop, as well. Just use the word variable you created in the loop to add to what you are already printing. Also, the challenge wants a space between the two words, as well.

Grayson Jones
Grayson Jones
550 Points

Would you show that to me in the code?

Jon Wood
Jon Wood
9,884 Points

Sure! I'll just add the loop part. I'm going to omit the variable to add too, so you can fill that in.

for words in hellos:
        print({for variable here} + ' ' + 'World')
Grayson Jones
Grayson Jones
550 Points

Thank you based Wood God