why i have the output of [None, None, None]
length power
elearn2014 at gmail.com
Thu Apr 10 09:54:40 EDT 2014
>>> x=['','x1','x2','x3',' ']
>>> x
['', 'x1', 'x2', 'x3', ' ']
>>> [print("ok") for it in x if it.strip() !=""]
ok
ok
ok
[None, None, None]
i understand there are three 'ok' in the output,but why i have the output
of [None, None, None]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140410/6a4ec77f/attachment.html>
More information about the Python-list
mailing list