First time here? Check out the FAQ!
answered 2013-05-30 15:33:33 +0100
Try replacing
for j in range(len(fw)):
with
for j in fw.keys():
(In your code, fw is not a list, but a finite family, so its entries are not indexed by 0, 1, 2, ..., necessarily.)
fw