On Tue, 8 Sep 2009 13:23:43 -0700 (PDT) Maggie <la.f...@gmail.com>
wrote:

> On Sep 8, 4:17 pm, MRAB <pyt...@mrabarnett.plus.com> wrote:
> [snip] 
> I saw my mistake...now it is telling me the following --
> 
> Traceback (most recent call last):
>   File "formisano_count.py", line 22, in <module>
>     running_sum = running_sum + (int(item) * int(item))
> ValueError: invalid literal for int() with base 10: ''
> ..
> not sure what exactly i am doing wrong!

What this error means is that the int() constructor is passed an empty
string (''). So there is probably an empty line in your input file.

You can catch these with a simple

if item:
    # usual code goes here

/W


-- 
INVALID? DE!

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to