1# We can use the split() function and put a "," in the parameter
2# It'll return a list with the string split up by commas.
3txt = "hello, my name is Peter, I am 26 years old"
4
5x = txt.split(",")
6print(x)
7
8# You can also do this
9for thing in x:
10 print(thing)
1str = 'apple,orange,grape'
2
3#split string by ,
4chunks = str.split(',')
5
6print(chunks)
1# We can use the split() function and put a "," in the parameter
2# It'll return a list with the string split up by commas.
3txt = "hello, my name is Peter, I am 26 years old"
4
5x = txt.split(",")
6print(x)