📅  最后修改于: 2022-03-11 14:45:23.214000             🧑  作者: Mango
import operator
# '>': operator.gt
# '<': operator.lt,
# '>=': operator.ge,
# '<=': operator.le,
# '=': operator.eq
get_truth(1.0, operator.gt, 0.0)
...
def get_truth(inp, relate, cut):
return relate(inp, cut)
# you don't actually need an if statement here