Симонова Александра, 117 EvalFormulae 8571 | Обрядчикова Анастасия Романовна, 341 EvalFormulae 8653 | ||||
---|---|---|---|---|---|
f | 1 | import re | f | 1 | import re |
2 | 2 | ||||
3 | def evalform(formula, *args): | 3 | def evalform(formula, *args): | ||
t | 4 | name_args = sorted(set(re.findall('[a-zA-Z]+', formula))) | t | 4 | box = sorted(set(re.findall('[a-z]+', formula))) |
5 | return eval(formula, dict(zip(name_args, args))) | 5 | return eval(formula, dict(zip(box, args))) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|