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

Fatimah Ghazal
Fatimah Ghazal
1,848 Points

i don't know why i am not passing any of the python challenges

Bummer! Didn't find all the "Hello"s. I did the same in work spaces and it worked just fine

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

for hello in hellos:
    hello += " word" 
    print(hello)

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Brian Jensen has provided a valid and slightly more elegant answer, but I'd like to point out that your code is also valid. The mistake you made in your code is that you misspelled " world". You accidentally typed " word".

Take a look:

for hello in hellos:
    hello += " world" 
    print(hello)

The above code would have also been valid and passed the challenge! Good luck! :sparkles: