1import operator
2
3# '>': operator.gt
4# '<': operator.lt,
5# '>=': operator.ge,
6# '<=': operator.le,
7# '=': operator.eq
8
9get_truth(1.0, operator.gt, 0.0)
10
11...
12
13def get_truth(inp, relate, cut):
14 return relate(inp, cut)
15 # you don't actually need an if statement here