how to find not the next sibling but the 2nd sibling or find sibling "a" OR sinbling "b"

Kent Johnson kent at kentsjohnson.com
Thu Jan 19 13:10:01 EST 2006


localpricemaps at gmail.com wrote:
> i actually realized there are 3 potentials for class names.  either
> food or drink or dessert.  so my question is whether or not i can alter
> your function to look like this?
> 
>  def isFoodOrDrinkOrDesert(attr):
>     return attr in ['food', 'drink', 'desert']

Check the spelling of 'dessert' and give it a try.

Kent



More information about the Python-list mailing list