python中splite()返回值
2016-06-19 16:54
501 查看
python中使用splite()函数返回,却提示出错,原因为splite()返回值是一个列表,此列表有先后顺序,使用时取索引.
错误:
str = “title1****content1”
title,content = str.splite(‘**‘)
正确:
str = “title1****content1”
result = str.splite(‘**‘)
错误:
str = “title1****content1”
title,content = str.splite(‘**‘)
正确:
str = “title1****content1”
result = str.splite(‘**‘)
相关文章推荐
- Python-zip函数
- python3 实现的人人影视网站自动签到
- Python的字节编译
- __setattr__,setattr(),getattr__,getattr()及__getattribute__的区别
- Python-第三方库requests详解
- Python列表的内置方法
- python3 sorted的用法
- Python 字符串
- word frequency counter python 页面词汇频率小代码
- python基础篇-day1
- Python实现学校学生管理系统的自动登录
- python 统计单词个数---从文件读取版本---不去重
- 机器学习实战笔记3(决策树与随机森林)
- Python Channels笔记--Deploying
- Python Requests快速入
- Python2.7中的super方法浅见
- 为什么print在Python 3中变成了函数?
- python time模块函数
- Python字符串的内置方法
- Python文件处理之文件指针(四)