【发布时间】:2019-08-13 18:30:38
【问题描述】:
我需要根据自己的需要编辑代码,但不幸的是我没有选择从零开始重写,所以我必须了解这是什么,因为截止日期是 11 小时。帮助一个小辈找到他的工作
if text and segment:
if "Office" in segment:
if True in list(map(lambda x: x in text, _classes[_classB][0])):
return "Класс Б"
if "Warehouse" in segment:
if True in list(map(lambda x: x in text, _classes[_classB][0])) or \
True in list(map(lambda x: x in text and True in [w not in text for w in _classes[_classA][0]],
_classes[_classB][1])):
return "Class B"
return ""
return ""
你能解释一下到底是什么
True in list(map(lambda x: x in text and True in [w not in text for w in _classes[_classA][0]],_classes[_classB][1])):
或类似“unlambda”的东西?非常感谢
UPD:我需要添加一条规则:“如果土地大小 > 9000 则......”其中土地大小在另一列中”
【问题讨论】:
-
这就是可怕的代码。没有上下文,我真的不认为我们可以在这里提供太多帮助,抱歉,即使有了它,这也是不必要的复杂。你有我的同情:/