diff --git a/Functions.ipynb b/Functions.ipynb index df58b4c..721bc56 100644 --- a/Functions.ipynb +++ b/Functions.ipynb @@ -78,10 +78,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 7, + "metadata": {}, "outputs": [], "source": [ "#this function adds two numbers passed as parameters\n", @@ -128,9 +126,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "'helloworld'" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "add (\"hello\", \"world\") # ooops this is weird!!" ] @@ -208,23 +217,28 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 47, + "metadata": {}, "outputs": [], "source": [ "# subtract function \n", - "\n", + "def subtract(a,b):\n", + " return(a-b)\n", "# floorDivide function\n", - "\n", + "def floorDivide(a,b):\n", + " return(a/b)\n", "# divide function\n", - "\n", + "def divide(a,b):\n", + " return(a//b)\n", "# multiply function\n", - "\n", + "def multiply(a,b):\n", + " return(a*b)\n", "# getRemainder function\n", - "\n", - "# power function" + "def getRemainder(a,b):\n", + " return(a%b)\n", + "# power function\n", + "def power(a,b):\n", + " return(a**2)" ] }, { @@ -238,10 +252,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 39, + "metadata": {}, "outputs": [], "source": [ "assert add(4,5)==9, \"add function not working\"" @@ -249,10 +261,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 40, + "metadata": {}, "outputs": [], "source": [ "assert subtract(4,5)==-1, \"subtract function not working\"" @@ -260,10 +270,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 42, + "metadata": {}, "outputs": [], "source": [ "assert multiply(4,5)==20, \"multiply function not working\"" @@ -271,10 +279,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 49, + "metadata": {}, "outputs": [], "source": [ "assert divide(5,5)==1.0, \"divide function not working\"" @@ -282,10 +288,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 48, + "metadata": {}, "outputs": [], "source": [ "assert floorDivide(1,2)==0.5, \"floor divide function not working\"" @@ -293,10 +297,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 45, + "metadata": {}, "outputs": [], "source": [ "assert getRemainder(5,4)==1, \"getRemainder function not working\"" @@ -304,14 +306,19 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 46, + "metadata": {}, "outputs": [], "source": [ "assert power(3,2)==9, \"power function not working\"" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {