Python Python Basics Python Data Types Use .split() and .join()

Henry Moreno
Henry Moreno
292 Points

.. it appears a bit ambiguous

it appears a bit ambiguous is the string a menu ..

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

2 Answers

Steven Parker
Steven Parker
94,464 Points

The term "menu" is not a type of thing. It's just the name of a variable you will create. You will store the string in that variable.

Henry Moreno
Henry Moreno
292 Points

Ok I figured this out Thanks a ton... for your answer.

On TeamTreehouse: Error message is Bummer! Remember to reassign the menu variable with your joined string.

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

I run this additional step to check my results and I get the right answer.. What do you think ??

print(display_menu) Our available flavors are: banana split, hot fudge, cherry, malted, black and white .

Steven Parker
Steven Parker
94,464 Points

I think the "bummer" hint says it: you still need to put the final string into "menu".

Also, when posting code, use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down:   Or watch this video on code formatting.