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

Patrick Bergman
Patrick Bergman
8,889 Points

Hi, How can I complete a challange with scrummbled output?

This is my output:

Hello Hello Hello Tungjatjeta Hello Grüßgott Hello Ð’iтаю Hello dobrý den Hello hyvää päivää Hello ä½ å¥½ Hello 早上好

It is no wonder I don't pass the challange I would see. Does anyone know a fix?

Regards,

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

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

1 Answer

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

Hi there! You're fairly close here. What they want is "Hello World" then "Tungjajeta World" etc. Take a look at the for loop you need.

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

Note the space between the beginning quotes and "World". This will print out what it's expecting.