A notebook is rendered inline, code and outputs together. This one is the smallest honest example I could think of.

In [1]:
# Even Fibonacci numbers below four million (Project Euler #2)
a, b, total = 1, 2, 0
while b < 4_000_000:
    if b % 2 == 0:
        total += b
    a, b = b, a + b
total
Out[1]:
4613732
In [2]:
# The ratio the sequence converges to, for good measure.
print('ratio ->', b / a)
ratio -> 1.618033988749859