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

Emilio Andere
Emilio Andere
495 Points

why is this split wrong

available = "banana split;hot fudge;cherry;malted;black and white" sundaes = "banana split;hot fudge;cherry;malted;black and white".split(;)

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

the values are already stored in the available variable so no need assign it to sundaes variable

here you can try like:

sundaes = available.split(";")

6 Answers

Mujibur Rahman
Mujibur Rahman
1,658 Points

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

sundaes = available.split(";")

The above worked fine for me, just tried it to see if it works.

Mujibur Rahman
Mujibur Rahman
1,658 Points

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

sundaes = available.split(";")

Mujibur Rahman
Mujibur Rahman
1,658 Points

the delimiter needs to be in quotes:

available = "banana split;hot fudge;cherry;malted;black and white" sundaes = "banana split;hot fudge;cherry;malted;black and white".split(";")

Emilio Andere
Emilio Andere
495 Points

still does not accept it

create a new variable named and use the split function

sundaes = available.split(";")

now recheck your work.