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

Not sure about this one...

I am working on this and it is asking for a for loop. It wants it to loop out but also add in World so it says "Hello World." I am not sure is it asking to add world next to hello in the actual hellos list. I was trying to use continue but kept getting an error. It makes sense in the video but am a bit stuck on this. Thanks for clarifying.

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

1 Answer

Afrid Mondal
Afrid Mondal
6,255 Points

Hi Dustin, The challenge is asking you to print each word in hellos with the word "World". So you need to iterate every word in hellos and print it with the word "World".

for word in hellos:
  print("{} World".format(word))

ah yes format. Of course. Thanks for the help with this. I am glad these lesson are pulling from earlier lessons so we can start tying it all together. Thanks for the help.