Python(1):HelloWorld
来源:互联网 发布:mysql修复数据表 编辑:程序博客网 时间:2024/05/29 08:11
python安装很简单,没有什么要注意的地方。
唯一要考虑的是,2.x版本和3.x版本。据说是改动太大,最好只能独立维护。不过初学者嘛,最好还是用新版本的了。
2.串联字符串,可以用+,也可以不用,直接写出来就行了
3.字符串格式说明符%s
"John Q. %s" % ("Public")"John %s%s" % ("Every","Man")
字符串依次被替换到%s的位置
>>> "%5s%s" % ("abc", "def")' abcdef' --空格补在左边>>> "%-4s%s" % ("abc", "def")'abc def' --空格补在右边
5.在字符串里面的转义字符,直接在shell中输入是没有效果的。但是print函数可以。
>>> "Rock a by baby, \n\ton the tree top, \t\when the windblows\n\t\t\t the cradle will drop"'Rock a by baby, \n\ton the tree top, \t\\when the windblows\n\t\t\t the cradle will drop'>>> print("Rock a by baby, \n\ton the tree top, \t\when the windblows\n\t\t\t the cradle will drop")Rock a by baby, on the tree top, \when the windblows the cradle will drop
2 0
- Python(1):HelloWorld
- (二)“HelloWorld!”by Python
- python初步(打印HelloWorld!)
- python学习笔记-(1)linux下的helloworld
- python helloworld
- Python - HelloWorld
- Python-helloworld
- Python嵌入C++详解(1)--HelloWorld
- Python嵌入C++详解(1)--HelloWorld
- 第一个程序(python)-HelloWorld
- 【python】python--helloworld
- WebService(1)HelloWorld
- GoodZhang在学Python(二)--Python环境安装配置&HelloWorld
- 用Python和Pygame写游戏-从入门到精通(1)HelloWorld
- 20080828 python HelloWorld
- Python之HelloWorld!
- python+django的helloworld
- Python Tkinter的HelloWorld
- 注解Annotation的IoC:从@Autowired到@Componen
- Purpose: xp_cmdshell 扩展存储过程的使用
- Eclipse:Could not create the view:解决办法
- Leetcode 436. Find Right Interval
- hdu 6012 Lotus and Horticulture(贪心)
- Python(1):HelloWorld
- 股票入门基础知识43:利用多时间框架分析
- 欢迎使用CSDN-markdown编辑器
- 浅学CMake
- 欢迎使用CSDN-markdown编辑器
- 自动导入上传数据的注意事项
- IE6中盒子绝对定位不起效果的解决方法
- python3.5 安装scrapy
- 51Nod - 1639 递推