Update snippet titles
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: unfold
|
||||
title: Unfold list
|
||||
tags: function,list,advanced
|
||||
firstSeen: 2020-01-02T20:17:51+02:00
|
||||
lastUpdated: 2020-11-02T19:28:35+02:00
|
||||
@ -14,7 +14,7 @@ Builds a list, using an iterator function and an initial seed value.
|
||||
```py
|
||||
def unfold(fn, seed):
|
||||
def fn_generator(val):
|
||||
while True:
|
||||
while True:
|
||||
val = fn(val[1])
|
||||
if val == False: break
|
||||
yield val[0]
|
||||
|
||||
Reference in New Issue
Block a user