关键字:
and
且or
或not
否del
import
导入from
import的来源while
while循环for
for循环if elif else
条件结构break
continue
global
声明全局变量with as
assert
断言pass
表示这是空块,eg,创建一个没有内容的类try
异常处理except
catch
yield
finally
break
print
打印class
类exec
in
遍历用,for循环或列表raise
引发一个异常is
判断两个对象是否相等return
函数返回值def
定义函数lambda
lamda表达式
运算符:
** | Exponentiation (raise to the power) |
~ + - | Complement, unary plus and minus (method names for the last two are +@ and -@) |
* / % // | Multiply, divide, modulo and floor division |
+ - | Addition and subtraction |
>> << | Right and left bitwise shift |
& | Bitwise 'AND' |
^ | | Bitwise exclusive OR' and regular OR' |
<= < > >= | Comparison operators |
<> == != | Equality operators |
= %= /= //= -= += *= **= | Assignment operators |
is is not | Identity operators |
in not in | Membership operators |
not or and | Logical operators |