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

please tell me how to solve this question

i have done it like this first i have made a new variable name= display_menu=("apple, banana") sundaes + ", ".join(display_menu)

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

1 Answer

I think you over-thought this question.

All you need to do is:

available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = sundaes.join(", ")
display_menu = "Our available flavors are: {}".format(menu)
  1. First I split the available variable by semi-colons and assign that to a variable called sundaes.
  2. Next, I join the elements in sundaes by separating by ", " and assign that value to menu.
  3. Last, I add the message "Our available flavors are: " to the beginning of menu and assign that to the final variable display_menu.

I hope you understand what's going on :)

Good luck! ~alex