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

Oops task 1 is no longer passing? But it passed, I am confused?

I am confused, it seems really simple, I hit check my work, and it says oops task 1 is no longer passing..

Task 1, set the variable available to the variable sundaes, with a .split function and split the semi colons...

Task 2, create a menu with a place holder that is undeclared, so basicly just a string.

Task 3, reassign the sundae function to display_menu, and instead of split, .join(', '), than go to the menu variable and at the end of the string add .format(display_menu) check work.. OPS task 1 is no longer passing. Okay I tried many different things, adding and removing lines, changing functions and variables... Eh.. kind of annoying, knowing it something simple, and having to wait to continue and post this.

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

3 Answers

The problem is on line 4. The line should look like display_menu = ', '.join(sundaes). You just mixed up the variables and the syntax of the join method. Help this helps!

i changed it, still having problems with it.

Could you post your current code? The last line should be menu = menu.format(display_menu) I think that may be the problem.

soon as i went back, I found the problem, I changed line 4, but deleted line 5. I had to re-add line 5. thanks

Your welcome