【发布时间】:2013-02-27 20:28:42
【问题描述】:
def three_doubles(s):
for i in range(0, len(s)-5);
if s[i] = s[i+1] and s[i+2] == s[i+3] and s[i+4] == s[i+5]:
return True
return False
尝试修改此代码以搜索具有至少两个连续双字母的单词
【问题讨论】:
def three_doubles(s):
for i in range(0, len(s)-5);
if s[i] = s[i+1] and s[i+2] == s[i+3] and s[i+4] == s[i+5]:
return True
return False
尝试修改此代码以搜索具有至少两个连续双字母的单词
【问题讨论】:
我没完全明白你问的是什么。
l=['asd','aabb','ccddee']
for w in l:
if len(w)>1:
if len(w)==(2*len(set(w))):
print w
【讨论】: