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

format

everything i do it just doesn't work

i'm stuck on the last part of the task which wants me to reassign the menu variable to use the existing variable and .format() to replace the placeholder with the new string in display_menu.

please help

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

1 Answer

AJ Salmon
AJ Salmon
5,675 Points

Almost everything is correct so far! There's a minor spelling error in your dispaly_menu variable; it should read display_menu. The last step seems counter-intuitive, you're going to re-assign the menu variable to the same string it already is, but formatted with the display menu. The goal is to get the variable menu to be the string 'Our available flavors are: banana split, hot fudge, cherry, malted, black and white.' So start with menu =, and then assign it to the string it wants, using menu.format(display_menu). Sorry if I spoiled it; this challenge is confusing, there's no way for me to feel like I'm actually explaining it well without giving you part of the answer. It seems like you understand .split() and .join(), which is the whole point, after all :)

Thank you for your response. yes the challenge is confusing but i figured it out with your so thank you again.

AJ Salmon
AJ Salmon
5,675 Points

My pleasure!!