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

Challenge Task 3 of 3 Alright, let's finish making our menu. Combine the sundaes list into a new variable named display

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

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

1 Answer

joshthorn
joshthorn
30,751 Points

This code solves it in one line.

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