modified code cell # simple arithmetic
M /docs/undefined +77 -89
1{2 "nbformat": 4,3 "nbformat_minor": 5,4 "metadata": {5 "kernelspec": {6 "display_name": "Python 3",7 "language": "python",8 "name": "python3"9 },10 "language_info": {11 "name": "python",12 "version": "3.12.0"2 "nbformat": 4,3 "nbformat_minor": 5,4 "metadata": {5 "kernelspec": {6 "display_name": "Python 3",7 "language": "python",8 "name": "python3"9 },10 "language_info": {11 "name": "python",12 "version": "3.12.0"13 }14 },15 "cells": [16 {17 "cell_type": "markdown",18 "metadata": {},19 "source": [20 "# Hello World Notebook\n",21 "\n",22 "A simple notebook to test rendering on sublimated."23 ]24 },25 {26 "cell_type": "code",27 "metadata": {},28 "execution_count": 1,29 "source": [30 "message = \"Hello from sublimated!\"\n",31 "print(message)"32 ],33 "outputs": [34 {35 "output_type": "stream",36 "name": "stdout",37 "text": [38 "Hello from sublimated!\n"39 ]40 }41 ]42 },15 "cells": [43 {44 "cell_type": "code",45 "metadata": {},46 "execution_count": null,47 "source": "# simple arithmetic\nresult = sum(range(1, 101))\nprint(f\"Sum of 1 to 100 = {result}\")\nprint(f\"Square of result = {result ** 2}\")",48 "outputs": []49 },50 {51 "cell_type": "markdown",52 "metadata": {},53 "source": [54 "## Data Table\n",55 "\n",56 "Execute result with HTML table output:"57 ]58 },59 {60 "cell_type": "code",61 "metadata": {},62 "execution_count": 3,63 "source": [64 "data = [\n",65 " {\"name\": \"Alice\", \"age\": 30, \"city\": \"Dublin\"},\n",66 " {\"name\": \"Bob\", \"age\": 25, \"city\": \"Berlin\"},\n",67 " {\"name\": \"Carol\", \"age\": 35, \"city\": \"Paris\"},\n",68 "]\n",69 "data"70 ],71 "outputs": [72 {17 "cell_type": "markdown",18 "metadata": {},19 "source": [20 "# Hello World Notebook\n",21 "\n",22 "A simple notebook to test rendering on sublimated."23 ]24 },73 "output_type": "execute_result",74 "execution_count": 3,75 "data": {76 "text/plain": "[{'name': 'Alice', 'age': 30, 'city': 'Dublin'}, {'name': 'Bob', 'age': 25, 'city': 'Berlin'}, {'name': 'Carol', 'age': 35, 'city': 'Paris'}]"77 },78 "metadata": {}79 }80 ]81 },82 {83 "cell_type": "markdown",84 "metadata": {},85 "source": [86 "## Error Handling\n",87 "\n",88 "Demonstrating error output rendering:"89 ]90 },91 {92 "cell_type": "code",93 "metadata": {},94 "execution_count": 4,95 "source": [96 "# this will raise an error\n",97 "1 / 0"98 ],99 "outputs": [100 {26 "cell_type": "code",27 "metadata": {},28 "execution_count": 1,29 "source": [30 "message = \"Hello from sublimated!\"\n",31 "print(message)"32 ],33 "outputs": [34 {35 "output_type": "stream",36 "name": "stdout",37 "text": [38 "Hello from sublimated!\n"39 ]40 }41 ]42 },43 {44 "cell_type": "code",45 "metadata": {},46 "execution_count": 2,47 "source": [48 "# simple arithmetic\n",49 "result = sum(range(1, 101))\n",50 "print(f\"Sum of 1 to 100 = {result}\")"51 ],52 "outputs": [53 {54 "output_type": "stream",55 "name": "stdout",56 "text": [57 "Sum of 1 to 100 = 5050\n"58 ]59 }60 ]61 },62 {63 "cell_type": "markdown",64 "metadata": {},65 "source": [66 "## Data Table\n",67 "\n",68 "Execute result with HTML table output:"69 ]70 },71 {72 "cell_type": "code",73 "metadata": {},74 "execution_count": 3,75 "source": [76 "data = [\n",77 " {\"name\": \"Alice\", \"age\": 30, \"city\": \"Dublin\"},\n",78 " {\"name\": \"Bob\", \"age\": 25, \"city\": \"Berlin\"},\n",79 " {\"name\": \"Carol\", \"age\": 35, \"city\": \"Paris\"},\n",80 "]\n",81 "data"82 ],83 "outputs": [84 {85 "output_type": "execute_result",86 "execution_count": 3,87 "data": {88 "text/plain": "[{'name': 'Alice', 'age': 30, 'city': 'Dublin'}, {'name': 'Bob', 'age': 25, 'city': 'Berlin'}, {'name': 'Carol', 'age': 35, 'city': 'Paris'}]"89 },90 "metadata": {}91 }92 ]93 },94 {95 "cell_type": "markdown",96 "metadata": {},97 "source": [98 "## Error Handling\n",99 "\n",100 "Demonstrating error output rendering:"101 ]102 },103 {104 "cell_type": "code",105 "metadata": {},106 "execution_count": 4,107 "source": [108 "# this will raise an error\n",109 "1 / 0"110 ],111 "outputs": [112 {113 "output_type": "error",114 "ename": "ZeroDivisionError",115 "evalue": "division by zero",116 "traceback": [117 "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",118 "\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",119 "Cell \u001b[0;32mIn[4], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# this will raise an error\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;241;43m1\u001b[39;49m \u001b[38;5;241;43m/\u001b[39;49m \u001b[38;5;241;43m0\u001b[39;49m\n",120 "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"121 ]122 }123 ]101 "output_type": "error",102 "ename": "ZeroDivisionError",103 "evalue": "division by zero",104 "traceback": [105 "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",106 "\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",107 "Cell \u001b[0;32mIn[4], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# this will raise an error\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;241;43m1\u001b[39;49m \u001b[38;5;241;43m/\u001b[39;49m \u001b[38;5;241;43m0\u001b[39;49m\n",108 "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"109 ]110 }125 ]111 ]112 }113 ]114}No newline at end of file