splitting list in python code example
Example 1: python split list
string = 'this is a python string'
wordList = string.split(' ')
Example 2: how to split word in python
text= "I am Batman"
splitted_text= text.split()
Print(splitted_text)
Example 3: python split list
string = "this is a string" # Creates the string
splited_string = string.split(" ") # Splits the string by spaces
print(splited_string) # Prints the list to the console
# Output: ['this', 'is', 'a', 'string']