Stanislav EvalFormulae 8435
Мельников Алексей, Севастополь EvalFormulae 7811
f1def evalform(formula, *args):f1def evalform(formula, *args):
2    var = ''2    var = ''
3    vars = set()3    vars = set()
4    for s in formula:4    for s in formula:
5        if s.isalpha():5        if s.isalpha():
6            var += s6            var += s
t7        else:t
8            if var:7        elif var:
9                vars.add(var)8            vars.add(var)
10            var = ''9            var = ''
11    if var:10    if var:
12        vars.add(var)11        vars.add(var)
13    vars = list(vars)12    vars = list(vars)
14    vars.sort()13    vars.sort()
15    vars_dict = {k: v for k, v in zip(vars, args)}14    vars_dict = {k: v for k, v in zip(vars, args)}
16    return eval(formula, vars_dict, None)15    return eval(formula, vars_dict, None)
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op