While, If, Count Statements

Stefan Ram Stefan Ram nospam.ram at zedat.fu-berlin.de
Sun Nov 26 20:26:00 EST 2017


Cai Gengyang <gengyangcai at gmail.com> writes:

  Statement 0:

>count = 0

  Statement 1:

>if count < 5:
>  print "Hello, I am an if statement and count is", count

  Statement 2:

>while count < 10:
>  print "Hello, I am a while and count is", count
>  count += 1

  There are three statements here.

  They are executed in the given sequence.

  First, statement 0 binds the name â»countâ« to an
  object which has the int-value â»0â«.

  Next, statement 1 prints â»am an ifâ«. Now statement 1
  was executed. It will never be revisited. It's history.

  Next, statement 2 will print "am a while" several times.
  It is separated from statement 2, like, totally.
  The statement 1 is in the remote past from where it
  never will return to be executed while the while
  loop is happily printing aways its "am a while" :-).
  Statement 1 is sad :-(, because it will never print no more.
  Never more.




More information about the Python-list mailing list