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

Ruben WhyDoILoseFocus
Ruben WhyDoILoseFocus
688 Points

.split() Command

I don't understand why this does not work. Thank you in advance. I wish treehouse had a self help option, where you can click help and not have to watch the video 100 times and still not understand.

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

3 Answers

There is nothing wrong with your code but you didn’t follow the instructions correctly. You are being asked to save that array to a variable named sundaes and also you should be splitting the variable, not the string. This code works:

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

hum4n01d,

Sir I feel so lost even after watching the videos 100 times. What other website do you recommend me to go to "so they can dumb it down". Thank You for your help I didn't see an example like this in the video so I felt lost.

Ruben

What do you mean, did my explanation not make sense?

Hey hum4n0ld haven't seen u in a while :)

I'm xela888

Agreed with your answer.

Your code should work just fine, I’ll look at the code challenge

Ruben WhyDoILoseFocus
Ruben WhyDoILoseFocus
688 Points

Hey guys I have lost all hope in learning python. I feel very discouraged the system just says bummer and does not tell you what you did wrong. Any help will be greatly appreciated.

Woah there! Python is awesome! See my answer below, you just have to read the instructions really carefully. This happens to me ALL the time :)

Ruben WhyDoILoseFocus , did that work? If so, please mark my answer as correct ;D

Ruben WhyDoILoseFocus
Ruben WhyDoILoseFocus
688 Points

Yeah it did but the next question says the first one is wrong. :( I have a snip but I don't believe I can add to a thread. Thank YOU!!!!