New course! Every coder should learn Generative AI!
Try a free lesson+ 2
What does .split() do in python
3 Answers
+ 5
Splits a string into list items according to the argument passed
a="hellowo,rld"
print(a.split(","))
a="hello world spam"
print(a.split(" "))
+ 4
you will be better off to try it in a code or read the documentation on that which will give you more insight on how the method works, that's just my 2 cent opinion for you
+ 3
a = 'i like python'
b = a.split()
print(b)
['i', 'like', 'python']
-------------------
f = banana
g = f.split('a')
print(g)
['b', 'n', 'n']