Converting a string to integer/float

Paul Rubin http
Thu Jan 22 04:48:13 CET 2004

aprogrammer at (Ikot) writes:
> I am stuck with a problem, might be very trivial, to ask here, but
> dont find a way out. I read a string like 12345.678 from a text file,
> which will be string for me, but how do I convert it into a float for
> my use ?

s = '12345.678'
x = float(s)

More information about the Python-list mailing list