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

Gregorio Bernabel
Gregorio Bernabel
3,412 Points

challenge task 1 of 3 python

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

its telling me it must be a list for sundaes

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

4 Answers

james south
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front End Web Development Techdegree Graduate 33,271 Points

the list of flavors is stored in available, so you call split on available, no need to copy and paste the flavors like that. the return of split is a list, and that's what you store in the new variable.

Gregorio Bernabel
Gregorio Bernabel
3,412 Points

so it should be available.split(";") or how ?

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Don't change available. You'll almost never need to change the code I give you.

Gregorio Bernabel
Gregorio Bernabel
3,412 Points

still can't figure it out. i mean i understood but for some reason it doesnt want to come as a list

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Try it in the Python shell. There's nothing secret going on behind the scenes in this code challenge, you see all of the code the whole time. Test it out in the shell or your own script. You'll get more insight into what's going on.

Gregorio Bernabel
Gregorio Bernabel
3,412 Points

thank you, everyone i nailed it! :D

Gregorio Bernabel
Gregorio Bernabel
3,412 Points

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