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

House Trigo
House Trigo
36,620 Points

Splitting and Joining (3 of 3)

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

Bummer! Didn't find the right series of sundaes and commas in menu.

2 Answers

Ferdinand Pretorius
Ferdinand Pretorius
18,705 Points

Hi House,

The code you have is correct, from what I can tell anyway, I think it's just the specific challenge and how the test was written. I've done my challenge as follow:

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

menu = menu.format(", ".join(sundaes))

Hope this helps!

House Trigo
House Trigo
36,620 Points

Hey Ferdinand,

I compared our solutions and it turns out that I forgot the period "." at the end of my menu string in task 2.

menu = "Our available flavors are: {}."

It's weird how this error allowed me to pass task 2 in the first place. Probably a bug in the challenge; hope it gets fixed soon.

Thanks for your help!

Ferdinand Pretorius
Ferdinand Pretorius
18,705 Points

I agree that is strange, I've made that mistake countless times, probably why I didn't pick up on it :p .

Either ways, I guess the bigger picture is that Treehouse does not only teach coding, but proper use of punctuation as well ( even if it is in a string :) )

Take care!

I just ran into this "issue" -- how the challenge/test is setup. I had the code syntax correct for part 3, added to end of menu variable ... but the test is structured to modify menu with a new line of code ... frustrating to say the least, burned some time on that one!

Ferdinand Pretorius
Ferdinand Pretorius
18,705 Points

I know, it is rather frustrating at times, but I can understand that writing some of these tests can be quite hard. It is especially true when testing .format on strings.