I have a few python strings parsed from a file where there are several hundred conditions that i need to evaluate. How would you experts out there recommend I evaluate these conditions? For example...
["20", "<=", "17.5"] # false
["15", ">=", "18.5"] # false
["20", "==", "20"] # true
["beta", "==", "beta"] # true
["beta", "!=", "beta"] # false
I wasn't sure if there were any tricks to resolving these equations, or if i should do some sort of if else like...
op = parts[1]
if op == '<=':
return op[0] <= op[2]
elif op == '>=':
return op[0] >= op[2]
elif op == '==':
return op[0] == op[2]
elif op == '!=':
return op[0] != op[2]