tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,5 @@
|
|||
>>> def eval_with_x(code, a, b):
|
||||
return eval(code, {'x':b}) - eval(code, {'x':a})
|
||||
|
||||
>>> eval_with_x('2 ** x', 3, 5)
|
||||
24
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
>>> def eval_with_args(code, **kwordargs):
|
||||
return eval(code, kwordargs)
|
||||
|
||||
>>> code = '2 ** x'
|
||||
>>> eval_with_args(code, x=5) - eval_with_args(code, x=3)
|
||||
24
|
||||
>>> code = '3 * x + y'
|
||||
>>> eval_with_args(code, x=5, y=2) - eval_with_args(code, x=3, y=1)
|
||||
7
|
||||
Loading…
Add table
Add a link
Reference in a new issue