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

Hellos in Different Languages prints random characters

So I have to print hellos of different languages from a list but I guess certain languages are not supported by my browser and print randow characters instead of the hello in a particular language. Because of this I get an error "Bummer! Didn't find all the hellos"

What should I do?

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

for each in hellos:
    print ("Hello " + each)

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Mit,

It's actually not a problem with the your browers, I don't think. It's because you have what the instructions are asking you to print kind of backwards. The string should be "<Hello in the language> World" but you are printing "Hello <Hello in language>.

So, you need to change your print statement to be:

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

Keep Coding! :) :dizzy:

Justin Radcliffe
Justin Radcliffe
18,987 Points

Hi Mit,

You may have to convert the letters giving you problems into html special characters:

ß = &szlig; <!--  <---- for example -->

Here's a good link to a reference:

HTML Special Characters Reference

Didn't solve my problem but learnt something new! Thanks :)

Oh God! That was silly.. Thank you Jason :)