语言基础: C like Language
动态类型, 脚本语言
量 | Number | String | List | ALL |
函数 | +,-,*,/, %, **, // | +, *, \, '', "", ('' ''), [ n], [m:n], | [O,O,O], [n], [m:n], +, . append(O), extend insert pop remove clear index count sort copy len(), list(range(m,n)) List Comprehesion [exp for x in ran if] Tuple: t = 1, 2, 3, "hello" | print(...) 赋值预算: a, b, c ..= exp1, exp2, exp3,..(先计算右边, 然后依次赋值) 自定义函数: def func(...): ..satement func(...) 默认参数定义:(缺省参数只计算一次) def f(a, b=1): Keywords参数: def f(a, action='do', aa='asd'): f(a, aa=''dd') 任意参数: def f(*args) def f(**args) Unpack list args = [3, 6] list(range(*args)) parrit(**d) |
流程控制 | 分支: if condition: ... elif condition: ... else: ... 循环: for i in [list, range()] ... [break/continue] else ... while conditon: xxx [break/continue] else: ... pass |