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

Darrell Spinler
Darrell Spinler
1,414 Points

The "check work" step is stating that Step 1 is no longer valid, but step 1 was completed on Line 2 and hasn't changed.

Am I doing something wrong, or is this a bug?

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

3 Answers

Hi there,

This can take some getting used to, because it works the other way around in some other languages, but in Python .join() is called on the join string, not the list. This is an easy fix, though! You just need to switch the positions of the list and the string on that line, like this:

display_menu = ", ".join(sundaes)
Darrell Spinler
Darrell Spinler
1,414 Points

Thank you!, that is a bit different!

Alex Bazzi
Alex Bazzi
208 Points

is this lesson especially harder than the rest to anyone else? It made me feel very stupid for not having a single clue what was going on for step 3.