wasm-demo/demo/ermis-f/python_m/cur/0387

49 lines
1.1 KiB
Plaintext

From: stidolph at origin.ea.com (Stidolph, David)
Date: Fri, 30 Apr 1999 13:33:26 GMT
Subject: Errors
Message-ID: <11A17AA2B9EAD111BCEA00A0C9B4179301E10E2B@forest.origin.ea.com>
X-UID: 387
try this...
tally = 0
for word in All_Words:
z = 0
while z < len(word):
if z == 0:
tally = tally + alpha.index(word[z])
else:
tally = tally + (alpha.index(word[z]) * 26)
The right side of the '=' is being done before the left, so you are trying
to read a variable that has not been initialized.
-----Original Message-----
From: smoothasice at geocities.com [mailto:smoothasice at geocities.com]
Sent: Thursday, April 29, 1999 4:17 PM
To: python-list at cwi.nl
Subject: Errors
Ok I have been using python and I have noticed that the errors aren't
truly helpful.. I don't know if I just didn't learn this properly but I
dont' know why this generates an error:
for word in All_Words:
z = 0
while z < len(word):
if z == 0:
tally = tally + alpha.index(word[z])
else:
tally = tally + (alpha.index(word[z]) * 26)
It gives me this: NameError: tally
and I don't know why......
THanks,
Anton