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 trialAaron Mesh
1,001 PointsNot sure what my mistake is in the code
So I just double checked all the stuff I have currently done in another python shell (IDLE) and I seem to be getting the right answer also the reason for what I did wrong do not make any sense to me. There was no request to order the sundaes in a certain way and I don't know what they are talking about when they say there is a comma in menu
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are: {}."
display_menu = menu.format(", ".join(sundaes))
1 Answer
Samuel Ferree
31,722 PointsThere's nothing wrong with your code per say, it's just not exactly what the challenge is asking for.
The challenge wants you to store the joined list in display_menu.
Then reassign menu to it's formatted self, when passed in display_menu as the placeholder.
The code below should pass the challenge.
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are: {}."
display_menu = ", ".join(sundaes)
menu = menu.format(display_menu);