Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70037

why i have the output of [None, None, None]

Date 2014-04-10 21:54 +0800
Subject why i have the output of [None, None, None]
From length power <elearn2014@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.9135.1397138088.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

>>> 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]

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

why i have the output of [None, None, None] length power <elearn2014@gmail.com> - 2014-04-10 21:54 +0800
  Re: why i have the output of [None, None, None] Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2014-04-10 17:18 +0300
  Re: why i have the output of [None, None, None] Rustom Mody <rustompmody@gmail.com> - 2014-04-10 07:18 -0700

csiph-web