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

Chris Ford
PLUS
Chris Ford
Courses Plus Student 2,259 Points

Hello. I am stuck using the format function. It is in conjunction with the split and join functions as well

I was able to split the list and join with a coma but asked to use the format function with a new variable and an existing variable and no matter how many combinations i tried to use i was not having any luck. Tried looking online and it got to the point where it said my first task wasn't working anymore? Went back to the video but doesn't get into the format function that deeply. Know i am probably missing something small but that is all it takes with computers. lol

banana.py
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")

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

1 Answer