[Tutor] Problem with tuple and dictionary
Mike Yuen
myuen@ucalgary.ca
Tue, 13 Nov 2001 17:02:55 -0700 (MST)
I'm writing a larger program and for some reason, I keep getting an error
at the following:
matrix[(curr,last)] = int(diff)
Here's some more code in case the above line isn't the actual problem:
def compare (self, last, dict):
#
# Some other irrelevant stuff here
#
while (curr < last):
dcurr = dict[curr]
end = len(dict[last])
for index1 in range(end):
if dcurr[index1] != dlast[index1]:
diff = diff + 1
matrix[(curr,last)] = int(diff) #WhAT's UP HERe?
curr = curr + 1 #Get next applicable dict entry
diff = 0
index1 = 0
Thanks,
M