Welcome to the Treehouse Community
Looking to learn something new?
Why is the loop not finding all strings in list?
I am attempting to figure out why the loop is not finding all the strings in the hellos list. Also, how would I add the "world" to each string in hellos?
for word in hellos: print(word) + "world" ?
I realize that it is in correct.
hellos = [ "Hello", "Tungjatjeta", "Grüßgott", "Вiтаю", "dobrý den", "hyvää päivää", "你好", "早上好" ] for word in hellos: print(word)
Your loop is correct, you are just missing adding the word "World" to them. And your incorrect example is actually far closer to correct than you probably realize.
You do in fact just add the
word variable to a string with
" World" in it (a space is needed at the start to avoid having the words run together). But you do this inside the print statement, you don't have the
+ outside it.
So the loop is meant to look like this:
for word in hellos: print(word + " World")