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()

weimeng yeo
PLUS
weimeng yeo
Courses Plus Student 301 Points

having difficulty solving this challenge. Can someone look at it and see where i have gone wrong ?

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

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

3 Answers

Shaik Asad
Shaik Asad
3,495 Points

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)

Shaik Asad
Shaik Asad
3,495 Points

Your code is correct but sometimes treehouse's challenge compiler compiles for the exact code. I got this wrong too. If you are stuck you can do this again(postin' on community. and btw why did you join the string 2 times!?

weimeng yeo
PLUS
weimeng yeo
Courses Plus Student 301 Points

Thanks !!! I got confuse. Will try it again. Much appreciated.

Shaik Asad
Shaik Asad
3,495 Points

Can we be friends? Is python your favourite programming language?

I went back through the docs and couldn't find anything wrong with the code, however it seems that there is a period character missing after the {}, which the challenge test engine will mark as incorrect, and result in a 'Bummer!' message. I think the answer is: available = "banana split;hot fudge;cherry;malted;black and white" sundaes = available.split(';') menu = 'Our available flavors are: {}.'.format(', '.join(sundaes))