Great! Thanks! On Dec 14, 2007 10:38 AM, Eric Smith <[EMAIL PROTECTED]> wrote:
> Victor Subervi wrote: > > Hi; > > Why can't I do this? > > > > >>> author = "By Juan Garcia" > > >>> if author[0:2] == "by " | "By " | "BY": > > ... author = author[3:] > > ... > > Traceback (most recent call last): > > File "<stdin>", line 1, in ? > > TypeError: unsupported operand type(s) for |: 'str' and 'str' > > > > This is a python question, not a plone question. The python logical or > operator is "or", but for this you might want to use "in". This code > might point you in the right direction, although it's not a complete (or > very good) solution: > > author = "By Juan Garcia" > if author[0:2] in ["by", "By", "BY"]: > author = author[2:] > print author > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Plone-Users mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/plone-users >
-- http://mail.python.org/mailman/listinfo/python-list