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 trialYasuhiko Tokunaga
928 PointsI can't understand why this code cause error. please help
available = "banana split;hot fudge;cherry;malted;black and white" sundaes = available.split(";") menu = "Our available flavors are: {}." display_menu = menu.fomat(", ".join(sundaes))
available = "banana split;hot fudge;cherry;malted;black and white"
2 Answers
jonlunsford
16,746 PointsYasuhiko:
I'm not sure what error you received, but it looks like you are missing the last couple steps.
Part 1 of 3: Split available and assign to sundaes - YOU DID THIS
Part 2 of 3: Create variable called menu and set it to the string - YOU DID THIS
Part 3 of 3: Combine sundaes into a new variable called display_menu
Step A of part 3. Create variable display_menu and rejoin each item in sundaes with a comma and space.
display_menu = ', '.join(sundaes)
Step B of part 3: Reassign the menu variable to use existing and format() to replace the placeholder with display_menu string.
menu = menu.format(display_menu)
Yasuhiko Tokunaga
928 PointsI acknowledge your kindness. I'm not good at English. So I did not understand what Question intended to. Now I understand. Thanks for your help
jonlunsford
16,746 PointsYou are very welcome! Glad it helped.
AJ Salmon
5,675 PointsAJ Salmon
5,675 PointsYou need an r in format :)