Error in Chain of Function calls

Girish Sahani girish at cse.iitb.ac.in
Fri Jun 9 03:58:51 EDT 2006


> Girish Sahani wrote:
>
>> However i am getting an error at the line marked with ***.
>
> what error ?
...line 266, in colocationMiner
prunedNew = genColocations(prunedK)
genColocations is a function defined before which returns prunedNew.
>
>> Also,i am getting a ValueError in the code below:
>>
>>               for s in prunedNew:
>>                 substrings = [s[:i]+s[i+1:] for i in range(len(s))]
>>                 for string in substrings:
>>                     if string not in prunedK:
>>                         prunedNew.remove(s)
>>                         continue
>>                     continue
>>
>> The error is:
>> prunedNew.remove(s)
>> ValueError: list.remove(x): x not in list
>
> the ValueError means exactly what it says -- have you verified that the
> value of "s" really is present in the list?  did you really mean to
> remove "s" and not, say, "string" ?
Yes. I want to remove s from the prunedNew list if that condition is not
satisfied.
>
> </F>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>




More information about the Python-list mailing list