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 trialNico Romero
1,365 PointsBe sure to use `.split()` to break apart `available`. Im not sure what that means since I have already used
I have tried using .split() to split both available = "banana split", etc and it gives me "do not change available, so i try just spiting the sting and it still marks it as incorrect. is there something I am miss you? Thank you
available = "banana split;hot fudge;cherry;malted;black and white"
"banana split;hot fudge;cherry;malted;black and white".split(", ")
sundaes = ["banana split", "cherry", "malted", "malted", "black and white"]
5 Answers
Brandon Jaus
13,681 PointsYou are using the .split()
method on the data that is being stored in the available
variable. This causes available
to reference a list that looks like ["banana split", "cherry", "malted", "malted", "black and white"]
. In order for you to pass this challenge, you need declare a variable called sundaes
and call the split()
method on the variable available
. It would like this:
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
Alexander Davison
65,469 PointsYou have the right puzzle pieces. You just need to put them together properly.
Remember that even if your code results exactly what the challenge asked for, the code must be the kind of code the challenge is expecting. The challenge is expecting you to call split()
then immediately assign whatever you get from that to sundaes
. I know, code challenges (especially the Python topic) are very picky!
Try this:
available = "banana split;hot fudge;cherry;malted;black and white"
sundaes = available.split(';')
I hope this helps
Happy coding!
~Alex
Cole Wilson
7,413 PointsThose don't appear to be separated by a comma "," but a semi-colon ";".
Nico Romero
1,365 PointsYeah, I tried that as well. I just changed it back, its still giving me the same error. Thank you Cole :)
Nico Romero
1,365 PointsWow, Thanks you guys, I didn't know you could do that. None of the examples we did touch on that, I was just trying to use ("; ") to split the variables. Thank you all so much
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsPosted to late
Brandon Jaus
13,681 PointsBrandon Jaus
13,681 PointsYeah I guess you posted that while I was in the process of typing it out.