Quantcast
Channel: Top-rated recipes
Viewing all articles
Browse latest Browse all 20

Linear equations solver in 3 lines (Python)

$
0
0

Python recipe 365013 by Maxim Krikun (programs). Revision 2.

Just a little bit of hack: a linear equations solver using eval and built-in complex numbers:

>>> solve("x - 2*x + 5*x - 46*(235-24) = x + 2")
3236.0

Viewing all articles
Browse latest Browse all 20

Trending Articles