python str + int
2015-06-06 12:22
686 查看
TypeError: cannot concatenate 'str' and 'int' objects
1. print 'Is your secret number " + str(p) + "?" 2. print 'Is your secret number %d?"%p (for multiple integers, you can '%d %d %d'%(num1, num2, num3) 3. print 'Is your secret number {0}?".format(p)
相关文章推荐
- 7.python高级特性:切片,迭代,列表生成式,生成器,迭代器
- python学习之基础数据类型
- Python ConfigParser模块教程
- python处理blog文件数据
- python - re (正则表达式的学习)
- Python3.X登录模拟CSDN,获取文章列表
- 用python实现排列
- python函数内嵌,嵌套函数
- Python使用mechanize模拟浏览器
- 黄聪:Python 字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、分割等)
- Python标准库:内置函数tuple([iterable])
- Python标准库:内置函数tuple([iterable])
- python操作Sqlite3详细整理
- Python Generator初探(二)
- 转:python安装pycrypto
- Python生成随机数的方法
- Python中的Lambda表达式小析
- Python多级排序(多属性排序)csv文件
- python 面相对象
- python paramiko sftp