New to Python
Jere Kahanpaa
kahanpaa at sky1.astro.helsinki.fi
Tue Sep 21 16:34:03 EDT 2004
Jimmie Webb <webbsoft2 at alltel.net> wrote:
> I tried x = float(nCost) but keep getting an error
> ValueError: Invalid literal for float(): EATE TA
Come on, do some basic debugging! Insert 'print repr(nCost)' before the
conversation and look at what you really are feeding to the float()
function. Well, we already now it: at some point you feed the string 'EATE
TA' to float(), and it obviously cannot convert this to a number.
Jere
--
Lord, make my words as sweet as honey, for one day I may have to eat them
- Daryl Benson
More information about the Python-list
mailing list