Python Python Basics (2015) Logic in Python Loop

why does it keep telling me it can't find all the Hellos?

After searching I'm sure this should be right although, I know I could still be wrong.

The issue I'm having is, it keeps saying it can't find all the hellos...

When I remade the helloS list it said i can't do that so I'm really confused as to what is wrong.

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

1 Answer

stjarnan
stjarnan
Front End Web Development Techdegree Graduate 56,482 Points

Hi Alexander,

You're writing a loop that stores the items in hellos in a new variable called hello, when you later inside that loop want to use the data you're looping through, you want to use your hello variable as this is the one storing each hello. Does that make sense to you?

Good luck,

Jonas

The moment you said about the new variable being hello opposed to hellos list i just face palmed! Edited too:

for hello in hellos:

print("{} world".format(hello))

Thank you for a fast easy to understand response!

Owe you one!