摘要:
1、函数对象优化多分支if的代码练熟 def foo(): print('foo') def bar(): print('bar') dic={ 'foo':foo, 'bar':bar, } while True: choice=input('>>: ').strip() if choice in 阅读全文
posted @ 2020-03-21 09:19
Python-feng
阅读(120)
评论(0)
推荐(0)
摘要:
1、函数对象 函数对象:指的是函数可以被当做’数据’来处理。 # func=内存地址 def func(): print('from func')func()输出结果: from func 具体可以分为四个方面的使用: (1)函数可以被引用 # func=内存地址 def func(): print 阅读全文
posted @ 2020-03-21 09:17
Python-feng
阅读(158)
评论(0)
推荐(0)