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

Pamela Zazueta
Pamela Zazueta
3,582 Points

Keeps asking me to use 'join.(", ") but I already did

I'm using the 'join.(", ") why is it saying I'm not

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

2 Answers

Umesh Ravji
Umesh Ravji
42,386 Points

Hi Pamela, on the 3rd line you are using join("; "), which should be a comma, not a semicolon.

In this challenge you have a list of sundaes that you have created using the split method, named sundaes. This is the variable that you want to provide to the join method, not the string available.

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

Got it. For some reason it's still saying "Did you use '.join.(", ")'

Umesh Ravji
Umesh Ravji
42,386 Points

What code are you trying?