{ "cells": [ { "cell_type": "markdown", "id": "5f7c74a4", "metadata": {}, "source": [ "## Markdown Cell\n", "This is a markdown cell." ] }, { "cell_type": "code", "execution_count": 1, "id": "7058dc82", "metadata": {}, "outputs": [ { "data": { "text/html": [ "Hello World" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "\n", " # This code cell will produce a display output\n", " from IPython.display import display, HTML\n", " display(HTML('Hello World'))\n", " " ] }, { "cell_type": "code", "execution_count": 2, "id": "b2956fd0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is a stream output.\n" ] } ], "source": [ "\n", " # This code cell will produce a stream output\n", " print(\"This is a stream output.\")\n", " " ] }, { "cell_type": "code", "execution_count": 3, "id": "929df6ae", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\n", " # This code cell will produce an execute result output\n", " 2 + 2\n", " " ] }, { "cell_type": "code", "execution_count": 4, "id": "cb7dcd0a", "metadata": {}, "outputs": [ { "ename": "ValueError", "evalue": "This is an error message.", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[4], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# This code cell will produce an error output\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis is an error message.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", "\u001b[0;31mValueError\u001b[0m: This is an error message." ] } ], "source": [ "\n", " # This code cell will produce an error output\n", " raise ValueError(\"This is an error message.\")\n", " " ] }, { "cell_type": "raw", "id": "a96d5fbf", "metadata": {}, "source": [ "This is a raw cell." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.8" } }, "nbformat": 4, "nbformat_minor": 5 }