字符串分隔 split
str1.split(sub_str, count)将str1字符串按照sub_str进行切割,
sub_str:按照什么内容切割字符串,默认是空白字符,空格,tab键
count:切割几次,默认是全部切割
返回值:列表[]
str1 = 'hello world IT Python and Pythonxcc'
result = str1.split() # 按照空白字符,全部切割
print(result)
print(str1.split('Python'))
print(str1.split('Python', 1)) # 切割一次,
print(str1.rsplit('Python', 1))