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

Eric Bane
Eric Bane
818 Points

Not sure how this is wrong

I worked out this problem workspaces too, and for some reason it is not being accepted even though it produces the correct line

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

2 Answers

Zachary Kaufman
Zachary Kaufman
1,463 Points

I copied and pasted your code into the challenge and it works if you add spaces before and after the = on lines 2 and 3. I hope this helps good luck!

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

I tried Zachary Kaufman 's solution without success. Even adding the spaces weren't enough to make it pass (for me). However, what did work was doing the menu formatting all on one line. Take a look:

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

Keep in mind that even code that's functional might not necessarily pass a challenge if it's not done in the exact way they are expecting. Hope this helps! :dizzy: