Re: How do I convert arithemtic string (like "2+2") to a number?
On Sat, Feb 05, 2005 at 02:11:07PM -0800, Michael Hartl wrote: > Use the eval function: > > >>> eval("30/(6+9)") > 2 > Thanks, just what I was looking for! -- http://mail.python.org/mailman/listinfo/python-list
How do I convert arithemtic string (like "2+2") to a number?
ool, as an excersise in "binary trees". I lost it, and most of my programming knowledge, but I figured perhaps there is a way to do this easily in python? It seems to me like it could be a common problem. /Arvid Andersson -- http://mail.python.org/mailman/listinfo/python-list