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 trialClinton van Heerden
210 PointsTask 1 exactly the same... but still an error message
Once again, I get the error message that Task 1 is no longer passing, when I have not changed anything in Task 1. It would be great to receive feedback on my errors in order for me to learn something... instead, the programming (ironically) doesn't work properly.
I'm starting to hate this.
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split("; ")
menu = "Our available flavors are: {"display_menu = sundaes.format(", ")"}."
2 Answers
Steven Parker
231,236 PointsOne quirk about the multi-task challenges is how they re-check all the previous tasks in order. This can get confusing if you have done something (such as introduced a syntax error) that invalidates the entire program. That causes all tasks (starting with the first) to fail.
In this case, the new third line has several syntax errors:
- it seems to have two separate assignments on the same line
- the "format" method (which is for strings) is being applied to a list
- there is a stray string following the "format" call
Samuel Ferree
31,722 PointsLooks like you just have some syntax errors.
First, Don't make an assignment in your template string, do that before
Second, you want to join the list of sundaes, not format them
Third, To use template strings in python, you don't need to quotes (") inside the curly braces ({}, also pre-pend your string with an f
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
display_menu = ", ".join(sundaes)
menu = f"Our available flavors are: {display_menu}."
Clinton van Heerden
210 PointsThanks for the response - your suggestion still isn't working though?
Now it says "Didn't find the right series of sundaes and commas in menu
."
Steven Parker
231,236 PointsThe challenge is apparently not designed to recognize the new format strings. The instructions also explicitly mention using ".format()".
Samuel Ferree
31,722 PointsPython 3.6 has format strings, it's version of template literals.