Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.

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