Py&禅

博客园 首页 新随笔 联系 订阅 管理

2010年6月1日 #

摘要: Problem:检查字符串中是否存在某些字符的集合Solution:下面的方法可以用在任何的序列容器中def containsAny(seq, aset): """ Check whether sequence seq contains ANY of the items in aset. """ for c in seq: if c in aset: return True return Fals... 阅读全文
posted @ 2010-06-01 13:04 Py&禅 阅读(222) 评论(0) 推荐(0)

摘要: # -*- coding:utf-8 -*-"""Created on 2010-5-21单链表的实现 1@author: Administrator"""class LinkedList(object): class Element(object): ''' 定义元素,包含了数据内容_datum和指向下一元素的链接_next ''' def __init__(self,list,datum... 阅读全文
posted @ 2010-06-01 05:37 Py&禅 阅读(336) 评论(0) 推荐(0)