📅  最后修改于: 2022-03-11 14:47:15.481000             🧑  作者: Mango
# credit to the Stack Overflow user in the source link
linked_list = {'a':'b', 'b': 'c', 'c': 'd', 'd': None}
def next_ll(state=['a']):
value = state[0]
if value is not None:
state[0] = linked_list[value]
return value
[x for x in iter(next_ll, None)]
>>> ['a', 'b', 'c', 'd']