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 trialvvsr sashank
1,393 Pointswhat to do?
hellos
hellos = [
"Hello",
"Tungjatjeta",
"Grüßgott",
"Вiтаю",
"dobrý den",
"hyvää päivää",
"你好",
"早上好"
]
2 Answers
Thomas Fildes
22,687 PointsHi vvsr,
Basically the challenge asks you to create a for loop to pass through each items in the list and print it out before the word 'World'. This is achieved with the code below:
for hello in hellos:
print(hello + " World")
you use the print function inside the loop to execute each item with a plus sign to add the string World at the end with a space before it so it doesn't stick the two words together. Hope this helps.
Happy Coding!!!
john larson
16,594 Pointslet me know if you need an explanation of this
for item in hellos:
print("{} World".format(item))
vvsr sashank
1,393 PointsThanks!