"vanam" <[EMAIL PROTECTED]> wrote
> Yes i did a mistake in expressing my problem below are the instances
> of the
> script and its corresponding output,for each instance its giving
> contrasting
> result i want explanation for that
> [1]:def squ(n):
> return n*n
> filter(squ,rang
vanam wrote:
> Yes i did a mistake in expressing my problem below are the instances of
> the script and its corresponding output,for each instance its giving
> contrasting result i want explanation for that
This has pretty much been explained already. Do you have some question
with the explanat
Yes i did a mistake in expressing my problem below are the instances of the
script and its corresponding output,for each instance its giving contrasting
result i want explanation for that
[1]:def squ(n):
return n*n
filter(squ,range(3))>output is not seen on the interpreter
ma
vanam wrote:
> ya i am sure about that i am using python editor which has python
> intrepreter attached to it i got the same output for both filter and map
> def squ(n):
>y = n*n
> print y
> filter(y,range(3))->0 1 4
> map(y,range(3))->0 1 4
You are not printing the result of either the fi
vanam wrote:
> i want to know the difference between filter(function,sequence) and
> map(function,sequence).
>>> print filter.__doc__
filter(function or None, sequence) -> list, tuple, or string
Return those items of sequence for which function(item) is true. If
function is None, return the ite
vanam wrote:
> ya i am sure about that i am using python editor which has python
> intrepreter attached to it i got the same output for both filter and map
> def squ(n):
>y = n*n
> print y
> filter(y,range(3))->0 1 4
> map(y,range(3))->0 1 4
This is quite different that what you posted the
On Tue, 23 Jan 2007, vanam wrote:
> i want to know the difference between filter(function,sequence) and
> map(function,sequence).
Hi Vanam,
They may both take functions as input, but the intention of the functions
is different. In the case of filter(), the input function is used to cull
the
ya i am sure about that i am using python editor which has python
intrepreter attached to it i got the same output for both filter and map
def squ(n):
y = n*n
print y
filter(y,range(3))->0 1 4
map(y,range(3))->0 1 4
On 1/23/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
vanam wrote:
> i want t
vanam wrote:
> i want to know the difference between filter(function,sequence) and
> map(function,sequence).I tried for a simple script with an function
> which finds the square of the number,after including separately filter
> and map in the script i am getting the same results for instance
> d