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

William Yau
PLUS
William Yau
Courses Plus Student 583 Points

Any options on how this code can be solved on challenge Task 3 of 3 Python Basics.

Challenge Task 3 of 3

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

Just did this one myself! When you redefine the "menu" variable, try: menu = menu.format(display_menu)

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey William,

You actually do have the correct answer, but you also have a couple of extra and irrelevant lines of code. Your last line of code is all you need.

menu = "Our available flavors are: {}".format(", ".join(sundaes))

The two lines before that essentially do what the last one is doing. So if you just delete these two

menu = "Our available flavors are: {}."
display_menu = sundaes.join(", ")

the Bummer! will go away for the 3rd task.

Just a note: This challenge is very picky, so if you are starting from task one again, you cannot paste the entire code block back in (as you can in most challenges). But you've got this...

Keep coding! :) :dizzy: