On Thu, 19 Jun 2014 12:25:23 +0100, MRAB <pyt...@mrabarnett.plus.com> wrote: [snip] > and then you can say: > > def myCase(c): > if len(c) < 8 or len(c) > 80: > return False > > if c in mySet: > return False > > return True > > which can be shortened to: > > def myCase(c): > return 8 <= len(c) <= 80 and c in mySet
Don't you mean . . . return 8 <= len(c) <= 80 and c not in mySet ? -- To email me, substitute nowhere->spamcop, invalid->net. -- https://mail.python.org/mailman/listinfo/python-list