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 trialSean Flanagan
33,235 PointsUse .split() and .join(), Task 3
Hi.
I can't work out where I've gone wrong on this last line. Please advise.
Thanks
Sean
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are: {}."
desserts.format(", ".join(sundaes))
2 Answers
Alexander Davison
65,469 Points"desserts" isn't an existing variable.
Since you haven't defined that variable yet, it will cause an error. Try changing "desserts" to "menu". :)
Good luck! ~Alex
Sean Flanagan
33,235 PointsHi Alex. That worked absolutely perfectly. Thanks for your help.
Sean :-)
Alexander Davison
65,469 PointsI'm happy It helped! ~Alex
Sean Flanagan
33,235 PointsSean Flanagan
33,235 PointsHi Alex.
Thanks for trying to help.
I tried this:
menu.format(", ".join(sundaes))
I got the reply:
Bummer! Didn't find the right series of sundaes and commas in `menu`.
I'd appreciate any further help on offer.
Sean
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsHmm... That's weird. I tested out your code with desserts as menu in the Python Shell, and it worked just fine. Maybe try combining the last two lines into one (this does the same thing but sometimes code challenges expect you to do it that way)?You code should look like this when you "combine" lines:
Good luck!