List question

From at home From at home
Fri Mar 21 18:16:41 EDT 2008


Hello,

I am learning python and dont quuite understand why is this happening
could someone explain?

alist = [] 
blist = [ 'one','two','one and two','one and four','five','one two']
for f in blist:
	if 'one' and 'two' in f:
		alist.append(f)
   
for i in alist:
    print i

two
one and two
one two


why is it printing the first "two"?

tia





More information about the Python-list mailing list