split a string to a list python code example
Example 1: python split
>>> '1,2,3'.split(',')
['1', '2', '3']
>>> '1,2,3'.split(',', maxsplit=1)
['1', '2,3']
>>> '1,2,,3,'.split(',')
['1', '2', '', '3', '']
Example 2: how to split word in python
text= "I am Batman"
splitted_text= text.split()
Print(splitted_text)