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 trialAysha Ayala
496 Pointsconcatenate?
I'm not sure what to join and what to format and how to type it out.
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
menu = "Our available flavors are: {} "
display_menu = sundaes + ', '.join(", ").format("menu {}")
Ashikur Rahman
Python Web Development Techdegree Student 932 PointsIf my answer was helpful for you don't forgot to mark it best answer and raise a vote.
2 Answers
Ashikur Rahman
Python Web Development Techdegree Student 932 PointsHere is your solution
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are: {}."
display_menu = ", ".join(sundaes)
menu = "Our available flavors are: {}.".format(display_menu)
Just paste it to figure out this step. Don't forgot to understand the code
Steven Parker
231,248 PointsActually, you are supposed to explain the code you post. Treehouse discourages posting of code answers without explanations.
Ashikur Rahman
Python Web Development Techdegree Student 932 PointsKenneth explained enough thought, isn't it? actually some time it's difficult to find out or build a logic for beginner. But no one wouldn't like to stack with a step. You should move even slowly and day by day brain will absorb automatically upon practice. Ignore it if I'm not right. Thanks
Steven Parker
231,248 PointsWorking out the answer for yourself using some hints actually helps most people learn better than just getting the final answer. "Understand the code" is not an effective learning technique for many people.
Steven Parker
231,248 PointsYou've got most of the parts there but the order needs a bit of work.
The join method is applied to a string (you got that right), but it should take the list as the argument. Then, that whole thing should be the argument to format, which would be applied to the template (which is in menu). The result goes back into menu.
You can do all that on a single line, or split it up and use display_menu as the halfway-done value.
I'll bet you can get it now without a spoiler.
Aysha Ayala
496 PointsAysha Ayala
496 PointsThank you so much I have been working on this for days! I know I need to problem solve and trouble shoot, this was my brick wall.