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

stuck on challenge

I can't see a reference name for the specific challenge. (implementation suggestion).

either way, it seems I am unable to pass the challenge despite believing I have grasped the lesson. I was able to get it do what I believe the instructions wants me to do using the workspace feature which make me suspect that there is a glitch/error with this specific challenge.

perhaps you should include a cheat sheet or scenario example that is slightly different. if you don't want to make it too easy you can add some sort of 'unlocked after x tries' or the like which forces the users to struggle a bit, but give them a hand before they get too frustrated.

as of now, I think this is a bit too subpar and you need to step it up a bit with this aspect of your site/service.

thanks.

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

3 Answers

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

Hi there! You're actually doing a lot better than you think you are. In fact, if I reorder your code, it passes all three steps. The problem here is that you're trying to format the menu with the display_menu variable in line 3. On line 4 you define display_menu. This leads to an error which states that it's not defined. And that's correct, as you are trying to use the variable before you define it. Just switch the placement of line 3 and line 4 and you should be good to go! Hope this helps! :sparkles:

Also (to add on to Jennifer Nordell's answer), code challenges are especially picky. Try changing the "our" to "Our". But first you must do what Jennifer Nordell said :)

Good luck! ~Alex

Thank you for the reply, it did the trick. :)

I didn't think about reordering the menu since it automatically comes out like that after completing step 1 and step 2 while also hinting at that everything can be accomplished on a single line.