#
(''')保持多行文本
(\n)换行,效率高
(\)继续上一行
+ 同类型数据相加(浮点型和整型)
%10s 左边10个字符串
%-5s 右边5个字符串
%d 整型
%F %f 浮点型(F,f)
%E %e 科学计数法
%X %x 十六进制
%o 八进制
%%d 转义
关键字(33个):
False class finally is return
None continue for lambda try
True def from nonlocal while
and del global not with
as elif if or yield
assert else import pass
break except in raise
help(open)
str(1.0)
type(1) dist:type({}) set:type([]) str:type("") tuple:type(())
infinity 无穷大 不够:截取;多余:四舍五入
虚数 i*i=-1
复数 y = 2 + 3j
三元操作符:Python2.5后:s = b if a < b else b
pass 占位符,不做任何事情
Ture:1
False:0
None:无响应动作 type:NoneType
##函数
#!/usr/bin/env python 3.4.2
not 取反 and or
dir()内部属性
docstring 文档字符串(首行缩进)__doc__
(''')保持多行文本
(\n)换行,效率高
(\)继续上一行
+ 同类型数据相加(浮点型和整型)
%10s 左边10个字符串
%-5s 右边5个字符串
%d 整型
%F %f 浮点型(F,f)
%E %e 科学计数法
%X %x 十六进制
%o 八进制
%%d 转义
关键字(33个):
False class finally is return
None continue for lambda try
True def from nonlocal while
and del global not with
as elif if or yield
assert else import pass
break except in raise
help(open)
str(1.0)
type(1) dist:type({}) set:type([]) str:type("") tuple:type(())
infinity 无穷大 不够:截取;多余:四舍五入
虚数 i*i=-1
复数 y = 2 + 3j
三元操作符:Python2.5后:s = b if a < b else b
pass 占位符,不做任何事情
Ture:1
False:0
None:无响应动作 type:NoneType
##函数
#!/usr/bin/env python 3.4.2
not 取反 and or
dir()内部属性
docstring 文档字符串(首行缩进)__doc__