>>>mylist = [1,2,3,4,1] >>>mylist.index(1) 0 But note that this only shows the index for the first occurrence of the item.
Bodsda Sent from my BlackBerry® wireless device -----Original Message----- From: surya k <sur...@live.com> Sender: tutor-bounces+bodsda=googlemail....@python.org Date: Thu, 8 Dec 2011 20:58:37 To: Python Tutor<tutor@python.org> Subject: [Tutor] how to find index of list with its value 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 _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor