Python Python Basics (2015) Logic in Python Loop

I need you to write a for loop that goes through each of the words in hellos and prints each word plus the word "World"

didnt find hello world

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

1 Answer

Miguel de Luis Espinosa
Miguel de Luis Espinosa
38,920 Points

Your code will never pass the if clause because there is no "world" in the hellos array.

You may want to delete the if clause and simply print each hello + the string "world"