1.split(str)函数
功能:将传入的字符串以”“(空格)为界限分开存入list.
str = "hello world !"
list = split(str)
print(list)
输出为:
['hello', 'world', '!']
str = "hello world ! "
list = split(str)
print(list)
输出为:
['hello', 'world', '!', '', '', '']
str = " "
list = split(str)
print(list)
输出为:
['', '', '', '']