On Jan 29, 1:55 pm, "jupiter" <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I have a problem. I have a list which contains strings and numeric.
> What I want is to compare them in loop, ignore string and create
> another list of numeric values.


You can iterate over the list and use the type() function to work out 
what each entry and choose what to do with it.

type() works like so:
###Code###
>>> a = ["test", 1.25, "test2"]
>>> if type(a[2]) == str:
        print "a string"


a string
>>>
###End Code###

Adam

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to