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 trialJosue Ramirez
933 PointsWhy is python unable to find the right series of sundaes in "menu"?
The problem I am having is with line 4, where I don't know whether I am incorrectly using .format or .join in this code. Any assistance with an explanation would be very much appreciated.
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are: {}."
menu.format(", ".join(sundaes))
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! You're actually doing great. So, I'm just going to give a hint here. You don't actually need a line 4. You should be tacking on the .format()
part to the end of line 3
Hope this helps!
Anish Palan
3,157 PointsHello, I think that the rule for using format is to use it in the same line as you initialise the string along with the {} parantheses. So in your case as Jennifer hinted out you need to add the .format((", ".join(sundaes))) to the end of line no 3. Hope that helps
Josue Ramirez
933 PointsJosue Ramirez
933 PointsThanks for the help