Diplodocus

A deterministic Python page

This example supplies executable content for the project's own documentation. The configured Python kernel shares state across all four cells.

values = [2, 4, 6]
total = sum(values)
import sys

print(f"Total: {total}")
print("Example stderr", file=sys.stderr)
Total: 12
Example stderr
from IPython.display import Markdown

Markdown(f"**Total:** `{total}`")

Total: 12

from IPython.display import SVG

SVG(f'<svg xmlns="http://www.w3.org/2000/svg" width="160" height="60" viewBox="0 0 160 60"><rect width="160" height="60" fill="#edf2f7"/><text x="16" y="38" fill="#1a202c">Total: {total}</text></svg>')
The total is twelve.

Return to the overview or read the execution explanation.