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 trialBenjamin Peters
552 PointsWhat is wrong with my for loop code?
hellos = [
"Hello",
"Tungjatjeta",
"Grüßgott",
"Вiтаю",
"dobrý den",
"hyvää päivää",
"你好",
"早上好"
]
for word in hellos:
print(word + "world")
hellos = [
"Hello",
"Tungjatjeta",
"Grüßgott",
"Вiтаю",
"dobrý den",
"hyvää päivää",
"你好",
"早上好"
]
for word in hellos:
print(word + "world")
2 Answers
Jennifer Nordell
Treehouse TeacherHonestly? Nothing is really wrong. This is an example of challenges being picky. You must follow the instructions to the letter. This means taking into consideration capitalization, punctuation, and white spaces when printing strings. Your code is printing the word + "world". This will result in the first print being "Helloworld" instead of "Hello World". Take a look at the formatting needed:
for word in hellos:
print(word + " World")
Benjamin Peters
552 PointsThanks! I will give that a try and see what happens. I appreciate the help.
Benjamin Peters
552 PointsYou were right! I needed to check my capitalization and spacing. Thanks! I'll look out for that in the future.
Jennifer Nordell
Treehouse TeacherBenjamin Peters You're quite welcome!