Generator with yield


We don't even need to use a temporary variable for it.

examples/generators/simple_generator.py
def number():
    yield 42
    yield 19
    yield 23

for n in number():
  print(n)

42
19
23