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

I think there is something wrong with the system that it keeps telling me task one is not passing, but it should be

I think there is something wrong with the system that it keeps telling me task one is not passing, but it should be

banana.py
available = "banana split;hot fudge;cherry;malted;black and white"

sundaes = available.split(";")



menu = "Our available flavors are :{}."

display_menu = sundaes.join(", ")

menu.format(display_menu)

2 Answers

Steven Parker
Steven Parker
231,248 Points

It only complains about task 1 because it rechecks it first.

Your task 1 work has not changed, but you now have a syntax error that makes all the tests fail.

Re-check your usage of join. It might seem like it should take a string argument like split does, but it's actually a string method that takes an iterable argument.

Also remember that the final result should be assigned back to menu.

Ronit Mankad
Ronit Mankad
12,166 Points

Hey Ode, actually you are using join method wrong.

Use this:

available = "banana split;hot fudge;cherry;malted;black and white"

sundaes = available.split(";")

menu = "Our available flavors are :{}."

display_menu = ", ".join(sundaes)

menu.format(display_menu)