Exactly three adjacent 3 in lists: Difference between revisions
→{{header|Python}}: Pruned out a dependency
(→{{header|Python}}: Pruned out a dependency) |
|||
Line 223:
=={{header|Python}}==
<lang python>'''N instances of N and all contiguous'''
from itertools import dropwhile, takewhile
Line 234 ⟶ 236:
def go(xs):
ns = list(takewhile(p, fromFirstMatch))
rest = [p(x) for x in xs[mbi:]]▼
rest
return p(len(ns)) and
return go
Line 261 ⟶ 265:
])
)
▲ )
|