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

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