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

Emilio Andere
Emilio Andere
495 Points

Please just tell me why this is wrong

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

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

2 Answers

Paul Harrison
Paul Harrison
5,533 Points

Hi Emilio - super close! The "=" is unnecessary, need to add the ":" at the end of the list to make it into a for loop, then just add a space in the print " World" so it'll output correctly. Like this:

for hellos in ["Hello", "Tungjatjeta", "Grüßgott", "Вiтаю", "dobrý den", "hyvää päivää", "你好", "早上好"]:
    print(hellos + " World")
Emilio Andere
Emilio Andere
495 Points

Paul, that is the message that appears: Bummer! Did you delete some lines? Please don't do that.

Paul Harrison
Paul Harrison
5,533 Points

For this challenge it doesn't like it when you delete the "hellos" list. Knowing you can't alter the "hellos" list, you will want to find a way to iterate through it. Example:

for hello in hellos:
    print(hello + " World")