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

Marcel Rüsenberg
Marcel Rüsenberg
858 Points

Task 1 is no longer working (python, use split and join)

First two steps work fine, but as soon as i do anything for step three, i get an error that says "Task 1 is no longer working" but I have no clue why, espcially since I changed nothing about the lines from Task 1 and 2

4 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Without seeing your code, it's impossible to help troubleshoot. But that error is a bit misleading. 99% of the time, that error is raised because a syntax error has been introduced into the code. So, if you say you get it when you try to complete Task 3, then the code you are putting in for Task 3 probably has a syntax error that is causing the code checker to throw the "Task one no longer passing." With this being Python, it a good chance that it is probably an indentation error. Double check your code for Task 3, and if you're still stuck, you will need to post the code for us to better help.

If copy / pasting code here, make sure you read the Markdown Cheatsheet of proper formatting so the code is readable. Or if you are asking questions right from the challenge, just make sure the "include code" box is checked.

:dizzy:

pouya yousefi
pouya yousefi
12,480 Points

Dear Marcel it's not possible to help you without seeing your code but here is the answer :

available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
menu = ("Our available flavors are: {}." ).format(", ".join(sundaes))
Marcel Rüsenberg
Marcel Rüsenberg
858 Points

I'm sorry for not adding the code I tried various versions like

available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(";")
menu = "Our available flavors are: {}."
display_menu = sundaes.join(", ")
menu = menu.format(display_menu)

or with changing the .format up to the original menu

menu = "Our available flavors are: {}.".format(display_menu)
display_menu = sundaes.join(", ")

and other things, but it just dont want to work

Marcel Rüsenberg
Marcel Rüsenberg
858 Points

well, since I ran out of imagination, I just used your soluton pouya, thank you but I am still unable to figure out why my solutions aren't working... btw. in your solution it works fine, but if i try

display_menu = ", ".join(sundaes)

instead of

display_menu = sundaes.join(", ")

I just get another error, dont know why the order is ok with the long line, but not with the short one...

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

In Python, you specify the string that'll be used between each item and then the list of things you want joined. So ", ".join(sundaes) is correct Python code and will work, while sundaes.join(", ") is non-valid code and won't pass.