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


Groups > comp.lang.python > #99030

Re: Question about 'print' in a loop

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Question about 'print' in a loop
Date 2015-11-19 14:11 +1100
Message-ID <mailman.444.1447902665.16136.python-list@python.org> (permalink)
References <75f51ee1-907c-47c4-9be9-58241ff83115@googlegroups.com>

Show all headers | View raw


On Thu, Nov 19, 2015 at 1:55 PM, fl <rxjwg98@gmail.com> wrote:
> There are only one time 5 'here' printed out, but there is no 'here' print
> out in thereafter call sq[2]() etc. How to understand this phenomenon?

Code does what code should.

Before you ask for comprehension of "this phenomenon", why don't you
tell us what you expect your code to do, and why? I just asked my
non-programmer sister and she was completely unsurprised by what
Python did here.

ChrisA

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


Thread

Question about 'print' in a loop fl <rxjwg98@gmail.com> - 2015-11-18 18:55 -0800
  Re: Question about 'print' in a loop Chris Angelico <rosuav@gmail.com> - 2015-11-19 14:11 +1100
    Re: Question about 'print' in a loop fl <rxjwg98@gmail.com> - 2015-11-18 19:20 -0800
  Re: Question about 'print' in a loop dieter <dieter@handshake.de> - 2015-11-19 08:31 +0100

csiph-web