On Thu, Dec 8, 2011 at 10:28 AM, surya k <sur...@live.com> wrote:

>
> Well, we all know to know the value when we have the index of a list. But
> how can we find it in the reverse way...
> say a listl=[1,2,3,4]
> l[0]=1.but how can I find its address with its value 1 ??
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>

l.index(1)

This will find the index of the first element with the value of 1

-- 
Joel Goldstick
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to