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 trialAlex Figueroa
2,148 PointsI've been stuck in this question for a few days and cannot seem to find an answer. Would you be able to assist me?
what am I supposed to enter in between .join()? Is it .join('sundaes')
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
menu = "Our available flavors are: {}."
display_menu = 'sundaes'
1 Answer
Billy Bellchambers
21,689 PointsHi Alex,
The task is asking for the list sundaes to be joined using a string of ', '. To achieve this you first need to declare the string and follow it with the join keyword with the list in brackets.
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
menu = "Our available flavors are: {}."
display_menu = ', '.join(sundaes)
This joins up the items in sundaes using a comma and a space to separate. Once joined we can then use the .format() function to plug this string into our menu using the place holder {}.
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)
Hope this helps with your python challenge.
Happy Coding!
Alex Figueroa
2,148 PointsAlex Figueroa
2,148 PointsThanks Billy. I'm just starting and I was doing well until I hit this road block. I appreciate it.
-AF