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

Can't find out the way to reach the goal. Plz help

Plz have a look into the solution i have given and tell me what is the thing i'am wrong at , which is not working enough to let me pass this task?

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

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Staff

Hi there! You're doing great and you have the syntax down pretty much. However, there's a problem here that's causing a syntax error. Remember, you may not use a variable before you have given it a value.

On line 3 of your code, you're trying to format the menu with display_menu. But at this point in your code, display_menu hasn't been defined. You don't define it until line 4. Simply changing the order of line 3 and line 4 corrects this. Your line #3 should be the one that starts with display_menu and your line #4 should be the one that starts with menu =.

Hope this helps, but let me know if you're still stuck! :sparkles:

thanx ma'am