摘要: Classes wishing to support the rich comparison mechanisms must add one or more of the following new special methods: def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... ... 阅读全文
posted @ 2013-10-30 20:32 LisPythoniC 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 昨天偶然看见一个算法题,要求返回一个包含给定英文字符串(小写)中所有最长的升序字符串的列表,比如:findmax('abc')-->['abc']findmax('afz')-->['afz']findmax('cba')-->['c','b','a']findmax('zfa')-->['z','f','a']findmax('abczabc')-->[&# 阅读全文
posted @ 2013-10-30 16:36 LisPythoniC 阅读(366) 评论(0) 推荐(0) 编辑