On Tue, Mar 31, 2015 at 3:23 PM, boB Stepp <robertvst...@gmail.com> wrote: > The following behavior has me stumped: > > Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. >>>> L = ['#ROI:roi_0', '#TXT:text_0', '#1:one^two^three'] >>>> for i, item in enumerate(L): > subitems = item.split(':') > if subitems[0] == '#ROI': > print subitems[1] > if subitems[0] == '#TXT': > print subitems[1] > if subitems[0] == '#1' or '#2':
Here's your problem: "#2" is always true. Try "if subitems[0] in ['#1', '#2']:" -- Zach _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor