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!

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

Andrew Duley
Andrew Duley
6,033 Points

Confused about Challenge Task 3 of 3

I am sorry but I can't figure out the 3rd task of the Python Basics questions. It says to set the menu variable to the currently existing variable and I'm just not sure what that is. I've tried many different answers and it typically tells me that "It looks like step won't won't pass" or something to that effect.

Thanks in advance

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

2 Answers

Jason Anders
Jason Anders
Treehouse Moderator 145,855 Points

Hey Andrew,

You are definitely on the right track :thumbsup:! Good job so far.
Everything is correct except for the line where you are joining the list. You have all the elements there, it's just a bit mixed up. You actually have to attach the join() method to the "how" not the other way around. So, that line should look like this:

display_menu = ", ".join(sundaes)

Notice that you have the ", " first and then the method, with the list being passed in.

Keep Coding! :) :dizzy:

Andrew Duley
Andrew Duley
6,033 Points

Thank you for the reply! I did some research around the web and figured out that's exactly what I was doing wrong. Now that see what it should look like, I immediately recall seeing that in one of the lessons. Funny how quickly the brain can forget things.

Thomas Shriver
Thomas Shriver
1,684 Points

I was doing the exact same with join. Thanks for question and answer.