{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Data Analysis with Jupyter Notebooks.\n", "\n", "# Tutorial 2 — Simple Calculations\n", "\n", "Benjamin J. Morgan, University of Bath." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Contents\n", "\n", "- [Simple Calculations](#simple_calculations)\n", "- [Comments and Markdown cells](#comments)\n", "- [Mathematical Functions and Modules](#functions_and_modules)\n", "- [Variables](#variables)" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Simple calculations\n", "\n", "One of the simplest forms of “code” that can be run in code cells is mathematical expressions:\n", "\n", ">```python\n", "1+2+3+4\n", "```" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">```python\n", "4*5/2\n", "```" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">```python\n", "2**4 - 2\n", "```" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`**` is the “power” operator. This code calculates $2^4 - 2$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "