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 Python Basics (2015) Python Data Types Use .split() and .join()

Did you use `.join(", ")`?

i have copied and pasted every answer in the communtiy but it still doesnt work. 1st and 2nd steps are ok bad cant get pass the 3rd one. a little help plz

banana.py
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes=available.split(';')
menu="Our available flavors are:{}.".format(available.split(';'))
today="Our available flavors are: {}.".format(", ".join(available.split(";")))

3 Answers

Kent Åsvang
Kent Åsvang
18,823 Points

Your code :

available = "banana split;hot fudge;cherry;malted;black and white"
sundaes=available.split(';')
menu="Our available flavors are:{}.".format(available.split(';'))
today="Our available flavors are: {}.".format(", ".join(available.split(";")))

You actually have already split ut the [available]-list, so you don't have to do that a second time for your string. Use the [sundaes] instead. Like so :

menu="Our available flavors are:{}.".format(sundaes)
today="Our available flavors are: {}.".format(", ".join(sundaes))

It should work just fine.

Good luck.

i did what you said, exactly the same sentence and still doesnt work. and now i am getting the error message: "Didn't find the right series of sundaes and commas in menu."

Kent Åsvang
Kent Åsvang
18,823 Points

Oh sorry, I messed up. Anyway, it should look something like this :

available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
sundaes_join = ", ".join(sundaes)
menu = "Our available flavors are: {}".format(sundaes_join)

i really thank you from the buttom of my heart