Python Python Basics (2015) Python Data Types Use .split() and .join()

Sean Frye
Sean Frye
1,167 Points

Shoot! I don't remember what to do.

I haven't been able to spend consistent time working on my courses. I know I would get this down if I had more consistent time on this, but I'm just getting so confused about it and I'm honestly not sure what I'm supposed to be doing.

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

2 Answers

Brett McGregor
PRO
Brett McGregor
Pro Student 1,903 Points

Hi Sean,

Check your syntax carefully. There are two syntax errors in your line of code.

Take a look at the Teacher Notes under the relevant video. That should help!

(https://teamtreehouse.com/library/python-basics/python-data-types/splitting-and-joining)

You are really close! First of all, when you declare a variable, you do not want the single-quotes ('). Second, you have the right idea with

'available'.split(;)

Your syntax error is on your ";" (semi-colon)... All you need to do is put your semi-colon between " (double-quotes)

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

Do you see the subtle difference? But great job, you had on the right process! Keep it up!