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 trialDustin Hicks
200 PointsHow do i split this on the (;)
How do i make a new one for this?
available = "banana split;hot fudge;cherry;malted;black and white"
2 Answers
Manish Giri
16,266 PointsYou just pass whatever you want to split on, into the .split()
function. In this case, you pass ;
, like .split(";")
.
Tony Castro
266 Pointsok, now I see where I went wrong. I was doing, words=sentence I didn't add the .split(";") on the new line. THANK YOU!!!
Tony Castro
266 PointsTony Castro
266 PointsI'm also a little stuck on this. I do the .split(";") but I still get it wrong/bummer. I think I'm messing up on the part where I have to assign it to a new variable. Any tips would be great.
Manish Giri
16,266 PointsManish Giri
16,266 PointsCan't say what's wrong without seeing your code, but the general way is this -
Now,
words
is a list that looks like['hello', 'world']
.