Python String Parsing Floats -
Python String Parsing Floats -
this question has reply here:
convert fraction float? 9 answershow alter '14/15' string float? trying extract info text file convert '1/3' float. float('1/3') doesn't work. thinking splitting 2 parts @ '/' 1 , 3 dividing, seems cludgy. there more pythonic way this? i'm using python 2.7
if trust input:
from __future__ import partition eval('14/15')
python python-2.7
Comments
Post a Comment