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 trial

Python

Challenge on Step 2 Part 10

available = "banana split;hot fudge;cherry;malted;black and white" "banana split;hot fudge;cherry;malted;black and white".split(";") sundaes = available.split(";") menu = "Our available flavours are: {}.".format(";").join(available) I have attempted the challenge multiple times and I've spent 4 hours trying to work it out.

1 Answer

Hi Rebecca,

Sorry to hear that you are having trouble with this challenge. Try no to get discouraged. :) The first part of the challenge it looks like you have it correct but you can simplify it by using the variable available.

available = "banana split;hot fudge;cherry;malted;black and white"

sundaes = available.split(";")

The second part asks to create a menu variable and make it equal to the string as shown below.

menu = "Our available flavors are: {}."

The third part of the challenge wants you to join the string in sundaes and then format the menu string.

string = ', '.join(sundaes)
menu = menu.format(string)

A good way to see what is going on here is to do this in the console so see what .split() and ''.join do to strings.

.