funcs = ['fetch_data_' + i for i in ( 'activities', 'banners', 'server_list')]# from operator import methodcaller# f=lambda fn:methodcaller(fn)(self)f = lambda fn: getattr(self, fn)()…
2018-04-09 update 利用python中的内置函数 eval() ,函数说明: def eval(*args, **kwargs): # real signature unknown """ Evaluate the given source in the context of globals and locals. The source may be a string representing a Python expression or a code obj…
1.三元运算 #1.三元运算 利用已下方法就可以实现一步运算返回a b中大的值 def my_max(a,b): c=0 a=int(input('请输入')) b=int(input('请输入')) # if a>b: # c=a # else: # c=b #或者这样 c = a if a > b else b return c ret=my_max(1,3) print(ret) 2.补充上节差的知识点 形参: #位置参数 #默认参数(关键字参数) #动态参数 *args:接收说有按照位…