Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (2015) Logic in Python Loop

Shoot! This is harder than I thought.

I believe I could get this down if I spent more time practicing and taking these courses so I could remember everything, but still, something seems different about this question than what I saw on the video itself.

I understand the coding I am supposed to type, I just don't know how to get the word "World" in there to make it say "Hello World"

hellos = [
    "dobrý den",
    "hyvää päivää",
for hello in hellos:
    if hellos == "Tungjatjeta":

2 Answers

for hello in hellos: print("%s World" %hello)

hellos is the array with all elements, and you are iterating through it, with hello being the the single elements for each iteration. And don't forget formatting, python is very strict there.

Thank you! I got it thanks to you, yet I'm actually still confused as to way it's set up this way. You did remind me about % as I forgot I can use that as ampersand.

Hoessein Abd
.a{fill-rule:evenodd;}techdegree seal-36
Hoessein Abd
Python Web Development Techdegree Graduate 19,107 Points

I think you misinterpreted the question a tiny bit. The list "Hello's has several 'hello' items in it in different languages. Kenneth is asking you to add the word 'World' to each item in 'Hello's.

So this should be printed.

"Hello World"

"Tungjatjeta World"

"Grüßgott World"

"Вiтаю World"

"dobrý den World"

"hyvää päivää World"

"你好 World "

"早上好 World"