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

manuel rojas
manuel rojas
266 Points

the system keeps asking me if I use .join

the system does not let me move on

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.format(display_menu)
Kenneth Love
Kenneth Love
Treehouse Guest Teacher

It's asking that because of your unnecessary () around the string in your .join() usage. That's a bad habit to have in Python.

3 Answers

Steven Parker
Steven Parker
231,269 Points

It apparently doesn't like the parentheses around the sting.

Try this instead:

display_menu = ", ".join(sundaes)

Also, it looks like you forgot the part about "Then reassign the menu variable ..." — don't forget to reassign menu with the final string.

Antonio De Rose
Antonio De Rose
20,885 Points

I tried this, and it worked, you have to bring down the menu at the last, for this challenge, and could you put a bracket, for join is a question.

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