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 trialSeamus Hannan
509 Points"Task one no longer works", but it does when I run through it again, and my code works in workspaces.
I must be missing something nitpicky in the tutorial setup, but I have no idea what it is. When I run the final code line it says either "task on no longer works" or something, or "Bummer! did you use ".join(",")" which isn't even the correct syntax I thought. ( ", ".join(sundaes) is what I was taught, and is, in fact, in there.)
This has become super frustrating.
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are: {}."
display_menu = menu.format(", ".join(sundaes))
1 Answer
Umesh Ravji
42,386 PointsHi Seamus, you can just replace the display_menu
variable at the end with menu
to make sure that the final result is assigned to the menu
variable.
# Simple change to existing code:
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are: {}."
menu = menu.format(", ".join(sundaes))
# More verbose way (not required):
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are: {}."
display_menu = ", ".join(sundaes)
menu = menu.format(display_menu)
Seamus Hannan
509 Pointsit worked, but how come I can just ignore their request for a display_menu variable when they are such sticklers about everything else?
Umesh Ravji
42,386 PointsIf you're really brave, you can even accomplish this all on the same line where menu is currently being set.
I think it's just something that the powers that be decided in this case :)
Seamus Hannan
509 PointsSeamus Hannan
509 PointsWhen I run this step-by-step in workspaces it works fine