Not sure if this is what you are looking for but... >>> li = ['this','is','a','list','of','strings'] >>> li = [l for l in li if li.index(l) >= li.index('a')] >>> li ['a', 'list', 'of', 'strings'] >>>
-- Sean Berry ~ Internet Systems Programmer BuildingOnline Inc. The Building Industry's Web Design and Marketing Agency Celebrating our 9th year in business, founded Aug. 1995 Ph: 888-496-6648 ~ Fax: 949-496-0036 --> Web Design Agency site: http://www.BuildingOnline.net --> Building Industry Portal: http://www.BuildingOnline.com --> Building Industry News: http://www.BuildingOnline.com/news/ --> Home Plans: http://www.eHomePlans.com "Bob Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I have a Python list. I can't figure out how to find an element's numeric > value (0,1,2,3...) in the list. Here's an example of what I'm doing: > > for bar in bars: > if 'str_1' in bar and 'str_2' in bar: > print bar > > This finds the right bar, but not its list position. The reason I need to > find its value is so I can remove every element in the list before it so > that the bar I found somewhere in the list becomes element 0... does that > make sense? > > Thanks, > > Bob -- http://mail.python.org/mailman/listinfo/python-list