November 2nd, 2013, 01:43 AM
I got this error from python any assistance would be greatly appreciate it.
print "YOU PAY: $",(float(pc)-total)
ValueError: invalid literal for float(): 8over20
November 2nd, 2013, 05:35 AM
Before you pass on variable 'pc' to the float function, may be, it would be a good idea to know what 'pc' refers to. Try putting a print statement before you use it in float and see if 'pc' really refers to a valid float.
November 2nd, 2013, 01:04 PM
pc seems to have been the literal
Often times printing a value is insufficient. You need the type as well. When debugging go straight for the throat,
Gosh I wonder why I never before this wrote dbg in python. Of course in J (www.jsoftware.com) dbg without the title is the hook
print "YOU PAY: $",(float(dbg(pc,'trouble with pc!'))-total)
dbg =: [smoutput
[/code] are essential for python code and Makefiles!