{ "metadata": { "name": "expressions" }, "nbformat": 2, "worksheets": [ { "cells": [ { "cell_type": "markdown", "source": [ "Expressions", "===========", "An expression is a command that returns a value. For example, if our command adds two numbers together then the valued returned is their sum." ] }, { "cell_type": "code", "collapsed": false, "input": [ "2 + 2" ], "language": "python", "outputs": [ { "output_type": "pyout", "prompt_number": 1, "text": [ "4" ] } ], "prompt_number": 1 }, { "cell_type": "markdown", "source": [ "If the command is to get the absolute value of a number, it returns the absolute value." ] }, { "cell_type": "code", "collapsed": false, "input": [ "abs(-2)" ], "language": "python", "outputs": [ { "output_type": "pyout", "prompt_number": 2, "text": [ "2" ] } ], "prompt_number": 2 }, { "cell_type": "markdown", "source": [ "The order of operations for mathmatical operations is the standard order." ] }, { "cell_type": "code", "collapsed": false, "input": [ "3 + 5 * 2" ], "language": "python", "outputs": [ { "output_type": "pyout", "prompt_number": 3, "text": [ "13" ] } ], "prompt_number": 3 } ] } ] }