This sample shows how a published notebook looks in the public HTML preview. Choose Run a copy in JupyterLite to execute or change the Python cells in your browser. Your copy is separate from the published version.
Run the cell below to add the numbers from 1 to 10.
numbers = range(1, 11)
total = sum(numbers)
print(f"The sum of 1 to 10 is {total}.")The sum of 1 to 10 is 55.
Change the range from 1–10 to 1–20, run the cell again, and compare the result. You can also download the .ipynb file from the preview page.