Girish Sahani a écrit :
> hi ppl,
> Here is a simple function to remove those keys of a dictionary whose
> values are less than some specified value.
>
> But it isnt working.
"is not working" is the worst possible description of a problem.
> def prune(d,cp):
> l = []
> for rule,value in
Girish Sahani wrote:
> hi ppl,
> Here is a simple function to remove those keys of a dictionary whose
> values are less than some specified value. But it isnt working. Please
> help.
>
Besides all the good advice you've been given about not expecting
string/float comparisons to be meaningful, re
On 6/27/06, John Machin <[EMAIL PROTECTED]> wrote:
> |>> '1.00' >= 0.5
> True
> |>> '0.33' >= 0.5
> True
>
> Python (correctly) does very little (guesswork-based) implicit type
> conversion.
At the same time, Python (incorrectly :) compares incomparable objects.
--
http://mail.python.org/mailman/
On 28/06/2006 12:15 PM, Girish Sahani wrote:
> hi ppl,
> Here is a simple function to remove those keys of a dictionary whose
> values are less than some specified value. But it isnt working. Please
> help.
>
> def prune(d,cp):
> l = []
> for rule,value in d.iteritems():
> #print
"Girish Sahani" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi ppl,
> Here is a simple function to remove those keys of a dictionary whose
> values are less than some specified value. But it isnt working. Please
> help.
>
> def prune(d,cp):
>l = []
>for rule,value in d.i