Questions tagged «first-class-functions»

5
Python-将一个函数传递给另一个函数
我正在使用python解决一个难题,根据要解决的难题,我将不得不使用一组特殊的规则。如何在Python中将一个函数传递给另一个函数? 例 def Game(listA, listB, rules): if rules == True: do... else: do... def Rule1(v): if "variable_name1" in v: return False elif "variable_name2" in v: return False else: return True def Rule2(v): if "variable_name3" and "variable_name4" in v: return False elif "variable_name4" and variable_name1 in v: return False else: return …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.