<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ah, the +1 is to add clarity to the program. updown is either 1, or -1,
or, better in this case, as +1 or -1. It's quite possible the code will
be read by others eventually. I'm emphasizing the purpose of the
variable by reminding the reader of its significance. Plus is
associated with moving forward along a line, and negative in the order
direction. <br>
<br>
I suppose this is similar to something I did long ago for a program
that I called p, just one letter. A colleague who was working with me
asked why I did that. It takes one key stroke to execute it was my
answer. When it got out of development, I gave it a more fitting name.
It also kept it easily visible from other programs and files in my
folder when I was looking for it. I suspect I really called it a.<br>
<br>
Yes, variations on !=, &lt;&gt;, not equal, .ne., ... Just a hold over
from former languages. <br>
<br>
Alan Gauld wrote:
<blockquote cite="mid:gb2q6b$u39$1@ger.gmane.org" type="cite"><br>
  <blockquote type="cite">Not really the code has an error so it could
not have worked.
    <br>
    <br>
    <blockquote type="cite">updown = +1
      <br>
    </blockquote>
  </blockquote>
  <br>
Is this meant to be
  <br>
  <br>
updown += 1
  <br>
  <br>
maybe?
  <br>
  <br>
Although as the error message shows you need to set it to a
  <br>
valid value before incrementing it, so mayber you just meant
  <br>
  <br>
updown = 1&nbsp; # no need for the + sign
  <br>
  <br>
  <blockquote type="cite">
    <blockquote type="cite">while keyop &lt;&gt; 0:
      <br>
    </blockquote>
  </blockquote>
  <br>
And the &lt;&gt; form of not equal is deprecated in favour of != so
  <br>
this should probably be
  <br>
  <br>
while keyop != 0
  <br>
  <br>
Or better still just
  <br>
  <br>
while keyop:
  <br>
  <br>
  <blockquote type="cite">You forgot to create keyop in this example.
    <br>
    <blockquote type="cite">UnboundLocalError: local variable 'updown'
referenced before assignment
      <br>
    </blockquote>
  </blockquote>
  <br>
HTH,
  <br>
  <br>
  <br>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta content="text/html;" http-equiv="Content-Type">
<title>Signature.html</title>
<pre class="moz-signature" cols="76">           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
              Obz Site:  39&deg; 15' 7" N, 121&deg; 2' 32" W, 2700 feet
<font color="#330099">            
</font>            "Though no one can go back and make a brand new start, 
             ANYONE can start from now and make a brand new end." 
                                    -- Anonymous
            
                    Web Page: &lt;<a class="moz-txt-link-abbreviated" href="http://www.speckledwithstars.net/">www.speckledwithstars.net/</a>&gt;</pre>
</div>
</body>
</html>