{ "cells": [ { "cell_type": "markdown", "id": "338584ee", "metadata": {}, "source": [ "# This is for practicing with Jupyter notebooks" ] }, { "cell_type": "markdown", "id": "7697c0b6", "metadata": {}, "source": [ "There are two types of cells: __Markdown cells__ and __Code cells__." ] }, { "cell_type": "markdown", "id": "f175b572", "metadata": {}, "source": [ "This is a Markdown cell. You can use this to a write an introdution to what the notebook is about, or to write description for your code fragment below and what it does, etc." ] }, { "cell_type": "markdown", "id": "50183206", "metadata": {}, "source": [ "
\n", "

Task 1: Create a Markdown cell


\n", " 1) Create a new MARKDOWN cell below
\n", " 2) Type whatever you want in the new cell!\n", "
\n" ] }, { "cell_type": "markdown", "id": "398371a1", "metadata": {}, "source": [ "
\n", "

Task 2: Editing a Markdown cell


\n", " Practice editing a Markdown cell. You can double click to edit, and then press ESCAPE to stop editing.\n", "
\n" ] }, { "cell_type": "markdown", "id": "faebc942", "metadata": {}, "source": [ "Here is a practice cell you can edit." ] }, { "cell_type": "markdown", "id": "1ae6cf3c", "metadata": {}, "source": [ "***\n", "Next, we have a code cell. Execute it now by pressing SHIFT-ENTER" ] }, { "cell_type": "code", "execution_count": null, "id": "f8c3df6e", "metadata": {}, "outputs": [], "source": [ "print('This is a code cell')" ] }, { "cell_type": "markdown", "id": "01b05760", "metadata": {}, "source": [ "
\n", "

Task 3: Code cell


\n", " 1) Create a new CODE cell below
\n", " 2) Copy the print statement from the cell above
\n", " 3) Change it to print \"This is MY code cell\"
\n", "
" ] }, { "cell_type": "markdown", "id": "bc0dfb12", "metadata": {}, "source": [ "***" ] }, { "cell_type": "markdown", "id": "829f27d9", "metadata": {}, "source": [ "
\n", "

Task 4: Practice with running code and restarting the kernel


\n", " 1) Execute the different cells below.
\n", " 2) Restart the kernel. Skip excuting the \"a=2\" cell, and then execute the rest. Observe what happens.\n", "
" ] }, { "cell_type": "code", "execution_count": 4, "id": "abe699d3", "metadata": {}, "outputs": [], "source": [ "a = 2" ] }, { "cell_type": "code", "execution_count": 7, "id": "651b7f67", "metadata": {}, "outputs": [], "source": [ "a = 4" ] }, { "cell_type": "code", "execution_count": 5, "id": "4ab3181e", "metadata": {}, "outputs": [], "source": [ "b = 1" ] }, { "cell_type": "code", "execution_count": 8, "id": "8d11d415", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a + b" ] }, { "cell_type": "code", "execution_count": null, "id": "390ff65b", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.9" } }, "nbformat": 4, "nbformat_minor": 5 }