Notebook
Search
⌃
K
Study hard and make progress every day
Mouka
Windows Internal
AntiCheat
DriverDevelopment
Python
Python Tricks
内置 http 服务器
函数作为变量
"is" vs "=="
直接变量值交换
计算代码执行时间
函数参数分解
打印Python字典
命名元组代替class
get()方法访问字典
字典排序
一次检查多个标志
合并两个字典
re.sub使用替换函数
Algorithms
Honey
Python笔记
Powered By
GitBook
Comment on page
函数作为变量
当作参数传递给其他函数
作为其他函数的返回值
赋值给变量或者存储在数据结构里
>>>
def
myfunc
(
a
,
b
):
...
return
a
+
b
...
>>>
funcs
=
[
myfunc
]
>>>
funcs
[
0
]
<
function myfunc at
0x107012230
>
>>>
funcs
[
0
](
2
,
3
)
5
Previous
内置 http 服务器
Next
"is" vs "=="
Last modified
4yr ago