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


Groups > comp.lang.python > #70042

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

Date 2014-04-10 15:59 +0200
From Johannes Schneider <johannes.schneider@galileo-press.de>
Subject Re: why i have the output of [None, None, None]
References <CAOmh462GH82jW3cfR-bW9nin9vf1uDB5_nMPiNch3t3H4mYWdg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.9138.1397140019.18130.python-list@python.org> (permalink)

Show all headers | View raw


because thats the return value of [...]
print retuns None.

On 10.04.2014 15:54, length power wrote:
>  >>> 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]
>
>


-- 
Johannes Schneider
Webentwicklung
johannes.schneider@galileo-press.de
Tel.: +49.228.42150.xxx

Galileo Press GmbH
Rheinwerkallee 4 - 53227 Bonn - Germany
Tel.: +49.228.42.150.0 (Zentrale) .77 (Fax)
http://www.galileo-press.de/

Geschäftsführer: Tomas Wehren, Ralf Kaulisch, Rainer Kaltenecker
HRB 8363 Amtsgericht Bonn

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


Thread

Re: why i have the output of [None, None, None] Johannes Schneider <johannes.schneider@galileo-press.de> - 2014-04-10 15:59 +0200

csiph-web