📜  python yield - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:26.041000             🧑  作者: Mango

代码示例1
def infinite_sequence():
    num = 0
    while True:
        yield num
        num += 1