def demo_yield():
    print("code segment 1 is executed")
    yield 1
    print("code segment 2 is executed")
    yield 2
    print("code segment 3 is executed")
    yield 3
    print("code segment 4 is executed")
    yield 4
    
