Errors

William Tanksley wtanksle at dolphin.openprojects.net
Thu Apr 29 19:22:51 EDT 1999


On Thu, 29 Apr 1999 21:16:50 GMT, smoothasice at geocities.com wrote:
>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:

The errors could certainly be improved, couldn't they?

>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......

This one's not too hard -- look at 'tally'.  What is its starting value?
You're trying to use a variable which has no value.  Try setting it to
zero somewhere.

>Anton

-- 
-William "Billy" Tanksley
"But you shall not escape my iambics."
           -- Gaius Valerius Catullus




More information about the Python-list mailing list