python中使用splite()函数返回,却提示出错,原因为splite()返回值是一个列表,此列表有先后顺序,使用时取索引.
错误:
str = “title1****content1”
title,content = str.splite(‘**‘)
正确:
str = “title1****content1”
result = str.splite(‘**‘)
python中使用splite()函数返回,却提示出错,原因为splite()返回值是一个列表,此列表有先后顺序,使用时取索引.
错误:
str = “title1****content1”
title,content = str.splite(‘**‘)
正确:
str = “title1****content1”
result = str.splite(‘**‘)