On 2012-12-06, Steven D'Aprano
<steve+comp.lang.pyt...@pearwood.info> wrote:
> total = 0
> for s in list_of_strings:
>     try:
>         total += int(s)
>     except ValueError:
>         pass  # Not a number, ignore it.

If it's internal data, perhaps. Of course, that would mean I had
the option of *not* creating that stupid list_of_strings.

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

Reply via email to