Beispiel #1
0
def takeWhile(): return Sequence.iterate(1, lambda k: k * 2).take_while(lambda k: k < 20)
def skipWhile(): return Sequence.range(0, 10).skip_while(lambda k: k < 6)
Beispiel #2
0
def iterate(): return Sequence.iterate(0, lambda k: k + 1, lambda k: k < 5)
def empty(): return Sequence.empty()
Beispiel #3
0
def take(): return Sequence.iterate(0, lambda k: k + 2).take(6)
def skip(): return Sequence.range(0, 6).skip(3)