Why does Python show the whole array?

Gilles Ganault nospam at nospam.com
Wed Apr 8 09:06:07 EDT 2009


On Wed, 08 Apr 2009 12:11:55 +0200, Ulrich Eckhardt
<eckhardt at satorlaser.com> wrote:
>find() returns the index where it is found or -1 if it is not found. Both an
>index>0 or a -1 evaluate to True when used as conditional expression.

Thanks everyone. I shouldn't have assumed that "if test.find(item):"
was necessarily enough to mean True.

for item in isp:
	#GOOD if item in test:
	if test.find(item) > 0:
		print test



More information about the Python-list mailing list