Re: Find index of item in list

2004-12-07 Thread Steven Bethard
wes weston wrote: Sean Berry wrote: myList = ['cat', 'dog', 'mouse' ... 'bear'] what is the easiest way to find out what index 'dog' is at? >>> myList = ['cat', 'dog', 'mouse','bear'] >>> myList.index('dog') 1 >>> Yup, list.index is almost certainly what you want, though it's worth mentioning t

Re: Find index of item in list

2004-12-07 Thread wes weston
Sean Berry wrote: Given myList = ['cat', 'dog', 'mouse' ... 'bear'] what is the easiest way to find out what index 'dog' is at? Sean, >>> myList = ['cat', 'dog', 'mouse','bear'] >>> myList.index('dog') 1 >>> wes -- http://mail.python.org/mailman/listinfo/python-list

Find index of item in list

2004-12-07 Thread Sean Berry
Given myList = ['cat', 'dog', 'mouse' ... 'bear'] what is the easiest way to find out what index 'dog' is at? -- http://mail.python.org/mailman/listinfo/python-list