1sentence = 'Hello world a b c'
2split_sentence = sentence.split(' ')
3print(split_sentence)
1def split(word):
2 return [char for char in word]
3
4word = "word"
5print(split(word))
6#output: ["w", "o", "r", "d"]
7
1def split(word):
2 return [char for char in word]
3
4# Driver code
5word = 'geeks'
6print(split(word))
7
8#Output ['g', 'e', 'e', 'k', 's']
1file='/home/folder/subfolder/my_file.txt'
2file_name=file.split('/')[-1].split('.')[0]
1# How to spit a word :
2
3text = "Word"
4text_list = list(text)
5print(text_list)
6
7# Output :
8# ["W", "o", "r", "d"]