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

Aron Katz
Aron Katz
700 Points

This loop is whacked

Following everything to the letter again, and still, I get an error saying "didn't find all the "hello"s....seriously? I have been following ever so closely and still it I'm wrong. Why is this stuff so buggy on this site?

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

3 Answers

Ben Schroeder
Ben Schroeder
22,818 Points

As I recall, that particular challenge requires the user to include a space before World. (So concatenate the string " World" instead of just "World")

Maybe give that a try?

Aron Katz
Aron Katz
700 Points

There is a space in between the + and "World" but that's not what's happening....I get "didn't find all the "hello"s" I tried it on the console with my own list and same variables and it worked fine, but I try it here with their stuff and it doesn't work, it never does.

Ben Schroeder
Ben Schroeder
22,818 Points

Are you sure? I just tried this in the challenge, and it worked:

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

for word in hellos:
    print(word + " World")
Aron Katz
Aron Katz
700 Points

Yea that did work....why does this have to be so frustrating?

Ben Schroeder
Ben Schroeder
22,818 Points

Yeah, the instructions for that one are unclear. I ran into the same problem as you.

Aron Katz
Aron Katz
700 Points

Thank you again.