初入python
来源:互联网 发布:授权查询系统源码 编辑:程序博客网 时间:2024/05/21 21:47
python:1.文本输入带引号,其中 ‘ ," , '"相同,输入文本返回文本,返回文本带‘***’单引号;2.通过print方法打印文本,返回文本内容,不会返回引号;3.>>> print("I said,"Don't do it") 该句会报错:SyntaxError: invalid syntax 1.用“/”进行转译 >>>print("I said,\"Don't do it\"") I said,"Don't do it" 1. """ 三引号 可以输入多行文本 \n 换行(pdf上面说 python 3.0 有 >>>print("hello","world")---hello world)>>> "hello" "world"'helloworld'>>> print(""" w)ar """) w)ar>>> print("i said \n \"hello world \"")i said "hello world ">>> print("hello","world")('hello', 'world') 1. %s 是占位符 具体用法 一个%s 表示一个占位符 %10s表示该出应该放入一个10个字符的字符串 one 自由三个字符串前面用空格代替 若为%-5 则是从左开始算>>> "Join %s%s" %("every","man")'Join everyman'>>> "%s %s %10s" %("join","every","one")疑问:>>> "\a\b\c\d\e\f\g\h\j\k\l\m\n\o\p"'\x07\x08\\c\\d\\e\x0c\\g\\h\\j\\k\\l\\m\n\\o\\p'>>> print( "rock a by baby,\n\ton the tree top,\t\when the windbows\n\t\t\t the crdel")rock a by baby, on the tree top, \when the windbows the crdel这是什么意思
阅读全文
0 0
- 初入python
- 初入python
- 初入python
- 初入python
- 初入Python
- 初入python
- 初入python
- Python+Selenium初入殿堂
- 初入python的几个坑
- 初入python思维导图
- Python核心编程——初入Python
- Python入门神图
- python 入门神图
- python入门神图
- Python Requests快速入
- Python入门神图
- <python> 匯入excel
- python入门神图
- 菜鸟上路 Spring Boot+Spring data jpa+swagger 做的增 删 改 查
- 获取字符串中的子串
- Java建造者(Builder)模式
- postgreSQL 去掉设置密码提示
- geometry-api-java 学习笔记(五)多边形 Polygons
- 初入python
- Android XHandler —极大方便UI线程和工作线程的切换
- ARM(s5pv210)裸板驱动之(系统时钟1)
- Redis安装(CentOS中)
- Git 使用(6)版本回退
- shiro笔记
- mysql left join,right join,inner join用法分析
- WPF 程序打包步骤
- win下jmeter运行NON GUI模式