Arthur wrote:
> if sum(x) !=0:
>    use this array
> else:
>    use other array.

be careful:

 >>> a = [1, 0, -1]
 >>> if a: print "true"
true
 >>> if sum(a) != 0: print "true"


that's why it's probably safer and more readable to use any() and all(), which 
i 
believe were both introduced to __builtin__ in py2.5.

- d
_______________________________________________
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig

Reply via email to