【Python】Learn Python the hard way, ex9 换行符,打印多行字符
2015-10-07 10:09
537 查看
# Here's some new stange stuff, remember type it exactly. days = "Mon Tue Wed Thu Fri Sat Sun" months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug" print "Here are the days: ", days print "Here are the months: ", months print """ There's something going on here. With the three double-quotes. We'll be able to type as much as we like. Even 4 lines if we want, or 5, or 6. """ """ Test Result: Here are the days: Mon Tue Wed Thu Fri Sat Sun Here are the months: Jan Feb Mar Apr May Jun Jul Aug There's something going on here. With the three double-quotes. We'll be able to type as much as we like. Even 4 lines if we want, or 5, or 6. """
心得:’‘’ 三引号这个用法要多练习
相关文章推荐
- Python的Set和List的性能比较 + 两者之间的转换
- Python 将一个目录下的所有word文档转为txt
- 如何查询python帮助文档;sublime 快捷键
- Python 集合set添加删除、交集、并集、集合操作符号
- 之前写的python文件
- python文本处理
- 【Python】Learn Python the hard way, ex8 格式化字符串
- python实例:backup 备份
- 【Python】Learn Python the hard way, ex7 字符串连接
- 【Python】Learn Python the hard way, ex6 格式化字符串,多行文本
- Python学习笔记<字符串Str>
- Python学习笔记<字符串Str>
- leetcode之Rotate Image
- 用python进行项目实训的计划
- 【Python】Learn Python the hard way, ex5 格式化字符串
- 和声搜索算法-python实现
- 克隆选择算法-python实现
- 细菌觅食算法-python实现
- 蝙蝠算法-python实现
- 人工免疫算法-python实现