New to Python

Jimmie Webb webbsoft2 at alltel.net
Tue Sep 21 16:10:15 EDT 2004


I tried x = float(nCost) but keep getting an error

ValueError: Invalid literal for float(): EATE TA


"Thomas Krüger" <thomas.krueger at gmx.net> wrote in message
news:ciq1kk$1jf$05$2 at news.t-online.com...
> w wrote:
>
> > excuse my ignorance. I cannot get this simple program to calculate
> > the formula.
> >
> > The error message is unsupported operand type(s) str. I know the data
> > that I'm reading from the file is a string but I cannot convert it to
> > a float or int.
>
> x = int(y)
> or
> x = float(y)
> ???
>
> Thomas






More information about the Python-list mailing list