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

Jamaru Rodgers
Jamaru Rodgers
3,046 Points

Having trouble with understanding loop syntax

I don't get what I need to do next, Is this just another instruction error?

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

3 Answers

Mason Frye
Mason Frye
8,870 Points

try this

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

Jamal, where your able to resolve your issue with this challenge? I encourage you to keep trying until you can resolve the challenge.

Since this was a "Python Basics" challenge, I think the issue was using a "for-loop" to print out the list.

Jamaru Rodgers
Jamaru Rodgers
3,046 Points

Yes, this helped me a lot, I did pass. Thank you!!

Your almost there Jamal. Good Job!

However, you want to perform "Concatenation" of strings in this case, which is only a "+" sign. If you a have not figured it out already, try updating the print statement to the following:

print(word + " World")

Thanks ~rbp

Mason Frye
Mason Frye
8,870 Points

.format() should be used instead of concatenation