split list based on if python code example Example: python split list string = 'this is a python string' wordList = string.split(' ')