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

The instructions say to "Combine the '''sundaes''' list into a new string". What does this actaully mean? Which string?

I am a bit confused on Task 3 of 3

The instructions tell me to “Combine the ‘’’sundaes’’’ list into a new string”. I am unclear on what this really means.

Then it asks me to “Use that string with a ‘’’.format()’’’ on our existing ‘’’menu’’’ variable and and replace the current value of ‘’’menu’’’. Does this mean we are supposed to change the ‘’’menu’’’ variable as it is, or start a new line?

I an attempt to get through this problem, I get an error message say that “It looks like Task 1 is no longer passing”. The following is my code:

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

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

2 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Your join syntax is backwards. Should be ", ".join(sundaes) because, in Python, you specify the joiner first. That's why task 1 is no longer passing (each previous task is evaluated every time).

For the last step, like the instructions say, you'll be redefining menu and then using .format().

I had to read this a few times, but now I have it. Thanks!