Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattjmorrison/863232 to your computer and use it in GitHub Desktop.
Save mattjmorrison/863232 to your computer and use it in GitHub Desktop.
>>> x = "(((a+b)/2+(c+d)/2)/2, (a-b)/2, ((a+b)/2-(c+d)/2)/2, (c-d)/2)"
>>> eval(x, {'a':1, 'b':2, 'c':3, 'd':4})
(2.5, -0.5, -1.0, -0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment