Alexander Zatvornitskiy wrote:
> epsilon=0
> S=0
> while epsilon<10:
> S=S+epsilon
> epselon=epsilon+1
> print S
>
> It will print zero, and it is not easy to find such a bug!
pychecker may help you find misspelled variable names. You have to move the
code into a function, though:
$ cat epsilon.py
def loop():
epsilon=0
S=0
while epsilon<10:
S=S+epsilon
epselon=epsilon+1
print S
$ pychecker epsilon.py
Processing epsilon...
Warnings...
epsilon.py:6: Local variable (epselon) not used
Peter
--
http://mail.python.org/mailman/listinfo/python-list