From 41f1f72e9502f5c3de6ca16b303803dfcf1df594 Mon Sep 17 00:00:00 2001 From: Thomas Stephen Lee Date: Fri, 4 Sep 2015 22:04:10 +0530 Subject: add/remove/update books --- .../KamthaneChapter10.ipynb | 2940 -- .../KamthaneChapter11.ipynb | 446 - .../KamthaneChapter12.ipynb | 849 - .../KamthaneChapter13.ipynb | 2367 -- .../KamthaneChapter14.ipynb | 2311 - .../KamthaneChapter15.ipynb | 1480 - .../KamthaneChapter16.ipynb | 2160 - .../KamthaneChapter3.ipynb | 1060 - .../KamthaneChapter4.ipynb | 972 - .../KamthaneChapter5.ipynb | 2624 -- .../KamthaneChapter6.ipynb | 42312 ------------------- .../KamthaneChapter7.ipynb | 3644 -- .../KamthaneChapter8.ipynb | 2750 -- .../KamthaneChapter9.ipynb | 1999 - Programming_in_C_using_ANSI_C/README.txt | 10 - .../screenshots/screenshot1.png | Bin 124312 -> 0 bytes .../screenshots/screenshot1_1.png | Bin 124312 -> 0 bytes .../screenshots/screenshot2.png | Bin 133043 -> 0 bytes .../screenshots/screenshot2_1.png | Bin 133043 -> 0 bytes .../screenshots/screenshot3.png | Bin 125297 -> 0 bytes .../screenshots/screenshot3_1.png | Bin 125297 -> 0 bytes 21 files changed, 67924 deletions(-) delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter10.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter11.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter12.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter13.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter14.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter15.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter16.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter3.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter4.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter5.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter6.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter7.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter8.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/KamthaneChapter9.ipynb delete mode 100755 Programming_in_C_using_ANSI_C/README.txt delete mode 100755 Programming_in_C_using_ANSI_C/screenshots/screenshot1.png delete mode 100755 Programming_in_C_using_ANSI_C/screenshots/screenshot1_1.png delete mode 100755 Programming_in_C_using_ANSI_C/screenshots/screenshot2.png delete mode 100755 Programming_in_C_using_ANSI_C/screenshots/screenshot2_1.png delete mode 100755 Programming_in_C_using_ANSI_C/screenshots/screenshot3.png delete mode 100755 Programming_in_C_using_ANSI_C/screenshots/screenshot3_1.png (limited to 'Programming_in_C_using_ANSI_C') diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter10.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter10.ipynb deleted file mode 100755 index 68503d70..00000000 --- a/Programming_in_C_using_ANSI_C/KamthaneChapter10.ipynb +++ /dev/null @@ -1,2940 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Chapter 10: Functions

" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.1, Page number: 320

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#user defined function\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "x = 1\n", - "y = 2\n", - "\n", - "#Function definition\n", - "def add(a,b):\n", - " return a+b\n", - "\n", - "#Function call\n", - "z = add(x,y)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"z = %d\"%(z))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "z = 3" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.2, Page number: 321

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call user-defined function at different places.\n", - "\n", - "import sys\n", - "\n", - "#Function definitions\n", - "def y():\n", - " sys.stdout.write(\" Y\")\n", - " return\n", - "\n", - "def a():\n", - " sys.stdout.write(\" A\")\n", - " y()\n", - " return\n", - "\n", - "def b():\n", - " sys.stdout.write(\" B\")\n", - " a()\n", - " return\n", - "\n", - "def c():\n", - " a()\n", - " b()\n", - " sys.stdout.write(\" C\")\n", - " return\n", - "\n", - "def d():\n", - " sys.stdout.write(\" D\")\n", - " c()\n", - " b()\n", - " a()\n", - " return\n", - "\n", - "#Function calls\n", - "y()\n", - "a()\n", - "b()\n", - "c()\n", - "d()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " Y A Y B A Y A Y B A Y C D A Y B A Y C B A Y A Y" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.3, Page number: 323

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Using similar variable names in different functions.\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def fun():\n", - " b = 20\n", - " c = 10\n", - " sys.stdout.write(\"\\nIn fun() B = %d C = %d\"%(b,c))\n", - " return\n", - "\n", - "#Variable Initialization\n", - "b = 10\n", - "c = 5\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nIn main() B = %d C = %d\"%(b,c))\n", - "fun()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "In main() B = 10 C = 5\n", - "In fun() B = 20 C = 10" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.4, Page number: 323

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Global variables on different functions.\n", - "\n", - "import sys\n", - "\n", - "#Global Variable Initialization\n", - "b = 10\n", - "c = 5\n", - "\n", - "def fun():\n", - " global b \n", - " b += 1\n", - " global c \n", - " c -= 1\n", - " sys.stdout.write(\"\\nIn fun() B = %d C = %d\"%(b,c))\n", - " return\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nIn main() B = %d C = %d\"%(b,c))\n", - "fun()\n", - "b += 1\n", - "c -= 1\n", - "sys.stdout.write(\"\\nAgain In main() B = %d C = %d\"%(b,c))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "In main() B = 10 C = 5\n", - "In fun() B = 11 C = 4\n", - "Again In main() B = 12 C = 3" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.5, Page number: 325

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Using return statement in different ways\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def pass1(a):\n", - " if a == 0:\n", - " return;\n", - " else:\n", - " return a*a*a\n", - "\n", - "#Variable Initialization\n", - "x = int(raw_input(\"Enter value of x : \"))\n", - "\n", - "#Function call & Result\n", - "if x != 1 or x > 0:\n", - " y = pass1(x)\n", - "\n", - "#There is no switch statement in python, so if..else statement\n", - "if y == 1:\n", - " sys.stdout.write(\"The value returned is %d\"%(y))\n", - "else:\n", - " sys.stdout.write(\"The Cube of %d is : %d\"%(x,y))\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter value of x : 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The Cube of 5 is : 125" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.6, Page number: 327

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display message using user defined function\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def message():\n", - " sys.stdout.write(\"Have a nice day\")\n", - "\n", - "#function call\n", - "message()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Have a nice day" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.7, Page number: 328

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display Alphabets 'A','B' and 'C' using functions\n", - "\n", - "import sys\n", - "\n", - "#Functions definitions\n", - "def a():\n", - " sys.stdout.write(\"\\nA\")\n", - " \n", - "def b():\n", - " sys.stdout.write(\" B\")\n", - " \n", - "def c():\n", - " sys.stdout.write(\" C\")\n", - " \n", - "#Function call\n", - "a()\n", - "b()\n", - "c()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "A B C" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.8, Page number: 329

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Send value to user defined function and display results\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def dat(x,y,z):\n", - " sys.stdout.write(\"Date = %d/%d/%d\"%(x,y,z))\n", - " \n", - "#Variable Initialization\n", - "d = int(raw_input(\"Enter date dd/mm/yy\"))\n", - "m = int(raw_input(\"Enter date dd/mm/yy\"))\n", - "y = int(raw_input(\"Enter date dd/mm/yy\"))\n", - "\n", - "#function call & Result\n", - "dat(d,m,y)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter date dd/mm/yy12\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter date dd/mm/yy12\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter date dd/mm/yy2001\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Date = 12/12/2001" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.9, Page number: 330

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Square of number using user defined function\n", - "\n", - "import sys\n", - "\n", - "#function definition\n", - "def sqr(k):\n", - " sys.stdout.write(\"\\n%d\"%(k*k))\n", - " \n", - "#Variable Initialization\n", - "j = 0\n", - "\n", - "#Function call & Result\n", - "for j in range(1,5):\n", - " sqr(j)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1\n", - "4\n", - "9\n", - "16" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.10, Page number: 330

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Pass the value to main() function\n", - "\n", - "import sys\n", - "\n", - "#There is no main function in python\n", - "sys.stdout.write(\"\\nNumber of command line arguments J = %d\"%(len(sys.argv)))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Number of command line arguments J = 6" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.11, Page number: 331

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Pass and return values to user defined function. \n", - "\n", - "import sys\n", - "\n", - "#Function Definitions\n", - "def dat(x,y,z):\n", - " sys.stdout.write(\"\\nToday = %d/%d/%d\"%(x,y,z))\n", - " x += 1\n", - " return x\n", - "\n", - "#Variable Initialization\n", - "d = int(raw_input(\"Enter Date dd/mm/yy : \"))\n", - "m = int(raw_input(\"Enter Date dd/mm/yy : \"))\n", - "y = int(raw_input(\"Enter Date dd/mm/yy : \"))\n", - "\n", - "#Function call\n", - "t = dat(d,m,y)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nTomorrow = %d/%d/%d\"%(t,m,y))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Date dd/mm/yy : 12\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Date dd/mm/yy : 12\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Date dd/mm/yy : 2001\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Today = 12/12/2001\n", - "Tomorrow = 13/12/2001" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.12, Page number: 332

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Send and recieve values to user defined function \n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def sum1(x,y,z):\n", - " return x+y+z\n", - "\n", - "#Variable Initialization\n", - "a = int(raw_input(\"Enter Three Numbers : \"))\n", - "b = int(raw_input(\"Enter Three Numbers : \"))\n", - "c = int(raw_input(\"Enter Three Numbers : \"))\n", - "\n", - "#Function call\n", - "s = sum1(a,b,c)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"Sum = %d\"%(s))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Numbers : 7\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Numbers : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Numbers : 4\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Sum = 16" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.13, Page number: 333

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Recieve values from user defined function without passing any \n", - "#value through main().\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def sum1():\n", - " x = int(raw_input(\"Enter Three Numbers : \"))\n", - " y = int(raw_input(\"Enter Three Numbers : \"))\n", - " z = int(raw_input(\"Enter Three Numbers : \"))\n", - " return x+y+z\n", - "\n", - "#Function call\n", - "s = sum1()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"Sum = %d\"%(s))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Numbers : 3\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Numbers : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Numbers : 4\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Sum = 12" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.14, Page number: 333

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Return value in the form of address.\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def sum1():\n", - " x = int(raw_input(\"Enter Three Values : \"))\n", - " y = int(raw_input(\"Enter Three Values : \"))\n", - " z = int(raw_input(\"Enter Three Values : \"))\n", - " k = x + y + z\n", - " return k\n", - "\n", - "#There is no pointer concept in python\n", - "\n", - "#Function call\n", - "s = sum1()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"Sum = %d\"%(s))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Values : 3\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Values : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Values : 4\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Sum = 12" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.15, Page number: 334

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call by value\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def change(a,b):\n", - " k = a\n", - " a = b\n", - " b = k\n", - " sys.stdout.write(\"\\nIn Change() X = %d Y = %d\"%(a,b))\n", - " \n", - "#Variable Initialization\n", - "x = int(raw_input(\"Enter Values of X & Y : \"))\n", - "y = int(raw_input(\"Enter Values of X & Y : \"))\n", - "\n", - "#Function call\n", - "change(x,y)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nIn main() X = %d Y = %d\"%(x,y))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Values of X & Y : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Values of X & Y : 4\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "In Change() X = 4 Y = 5\n", - "In main() X = 5 Y = 4" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.16, Page number: 335

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call by reference \n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def change(a,b):\n", - " k = a\n", - " a = b\n", - " b = k\n", - " sys.stdout.write(\"\\nIn Change() X = %d Y = %d\"%(a,b))\n", - " \n", - "#There is no pointer concept in python\n", - "\n", - "#Variable Initialization\n", - "x = int(raw_input(\"Enter Values of X & Y : \"))\n", - "y = int(raw_input(\"Enter Values of X & Y : \"))\n", - "\n", - "#Function call\n", - "change(x,y)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nIn main() X = %d Y = %d\"%(y,x))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Values of X & Y : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Values of X & Y : 4\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "In Change() X = 4 Y = 5\n", - "In main() X = 4 Y = 5" - ] - } - ], - "prompt_number": 8 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.17, Page number: 336

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Return by reference\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def change(a,b):\n", - " c = a + b\n", - " d = a - b\n", - " return c,d\n", - "\n", - "#Variable Initialization\n", - "x = int(raw_input(\"Enter Values of X & Y : \"))\n", - "y = int(raw_input(\"Enter Values of X & Y : \"))\n", - "\n", - "#Function call\n", - "add,sub = change(x,y)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nAddition : %d\"%(add))\n", - "sys.stdout.write(\"\\nSubtraction : %d\"%(sub))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Values of X & Y : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Values of X & Y : 4\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Addition : 9\n", - "Subtraction : 1" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.18, Page number: 337

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call by value and reference\n", - "\n", - "k = 0\n", - "m = 0\n", - "\n", - "#Function Definition\n", - "def other(k,m):\n", - " sys.stdout.write(\"\\nAddress of k & m in other() : %u %u\"%(id(k),id(m)))\n", - " \n", - "#Result\n", - "sys.stdout.write(\"\\nAddress of k & m in main() : %u %u\"%(id(k),id(m)))\n", - "\n", - "#Function call\n", - "other(k,m)\n", - "\n", - "#there is no pointer concept in python and it uses value tagged method in data storage\n", - "#instead of addressing the memory location, values of same variables are tagged together" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Address of k & m in main() : 30922996 30922996\n", - "Address of k & m in other() : 30922996 30922996" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.19, Page number: 338

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#User defined function as an argument to another function.\n", - "\n", - "#Variable Initialization\n", - "y = 2\n", - "\n", - "#Function Definitions\n", - "def double(m):\n", - " return m*2\n", - "\n", - "def square(k):\n", - " return k*k\n", - "\n", - "#Function call\n", - "x = double(square(y))\n", - "\n", - "#Result\n", - "sys.stdout.write(\"x = %d\"%(x))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "x = 8" - ] - } - ], - "prompt_number": 17 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.20, Page number: 338

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Two functions as arguments for another functions\n", - "\n", - "import sys\n", - "\n", - "#Function definitions\n", - "def x(a,b):\n", - " return abs(a-b)\n", - "\n", - "def y():\n", - " y = int(raw_input(\"Enter First Number : \"))\n", - " return y\n", - "\n", - "def z():\n", - " z = int(raw_input(\"Enter Second Number : \"))\n", - " return z\n", - "\n", - "#Function call\n", - "d = x(y(),z())\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nz() - y() = %d\"%(d))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter First Number : 25\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Second Number : 50\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "z() - y() = 25" - ] - } - ], - "prompt_number": 10 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.21, Page number: 339

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Return only absolute value like abs() function\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def uabs(y):\n", - " if y < 0:\n", - " return y * -1\n", - " else:\n", - " return y\n", - " \n", - "#Variable Initialization\n", - "x = int(raw_input(\"Enter a Negative Value : \"))\n", - "\n", - "#Function call\n", - "x = uabs(x)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nX = %d\"%(x))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Negative Value : -5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "X = 5" - ] - } - ], - "prompt_number": 11 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.22, Page number: 340

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Square and cube of an entered number. \n", - "\n", - "import sys\n", - "\n", - "#Function Definitions\n", - "def input1(): #Since input() is a built in function in python, input1() is used\n", - " k = int(raw_input(\"Number : \"))\n", - " return k\n", - "\n", - "def sqr(m):\n", - " sys.stdout.write(\"\\nSquare : %d\"%(m*m))\n", - " return m\n", - "\n", - "def cube(m):\n", - " return m*m*m\n", - "\n", - "#Function call and Result\n", - "sys.stdout.write(\"\\nCube : %d\"%(cube(sqr(input1()))))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Number : 2\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Square : 4\n", - "Cube : 8" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.23, Page number: 341

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Assign return value of a function to variable.\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def input1():\n", - " k = int(raw_input(\"Enter Value of x = \"))\n", - " return k\n", - "\n", - "#Function call\n", - "x = input1()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nx = %d\"%(x))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Value of x = 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "x = 5" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.24, Page number: 342

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Addition and subtraction of numbers with return value of function.\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def input1():\n", - " k = int(raw_input(\"Enter Value of x = \"))\n", - " return k\n", - "\n", - "def sqr(m):\n", - " return pow(m,2)\n", - "\n", - "#Function call\n", - "x = sqr(1 - input1() + 1)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nSquare = %d\"%(x))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Value of x = 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Square = 9" - ] - } - ], - "prompt_number": 14 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.25, Page number: 343

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Multiplication and division of numbers with return value of function.\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def input1():\n", - " k = int(raw_input(\"Enter Value of x = \"))\n", - " return k\n", - "\n", - "def sqr(m):\n", - " return pow(m,2)\n", - "\n", - "#Function call\n", - "x = sqr(5 * input1()/2)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nSquare = %d\"%(x))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Value of x = 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Square = 144" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.26, Page number: 344

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "# ++ operator with return value of function\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def input1():\n", - " k = int(raw_input(\"Enter Value of x = \"))\n", - " return k\n", - "\n", - "def sqr(m):\n", - " return pow(m,2)\n", - "\n", - "#Function call\n", - "#There is no ++ operator in python. so += operator is used\n", - "y = input1()\n", - "y += 1\n", - "x = sqr(y)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nSquare = %d\"%(x))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Value of x = 7\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Square = 64" - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.27, Page number: 345

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Use mod(%) with function\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def j():\n", - " x = int(raw_input(\"Enter a Number : \"))\n", - " return x\n", - " \n", - "#Function call & Result\n", - "if j() %2 == 0:\n", - " sys.stdout.write(\"\\nNumber is Even.\")\n", - "else:\n", - " sys.stdout.write(\"\\nNumber is Odd.\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number : 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Number is Odd." - ] - } - ], - "prompt_number": 17 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.28, Page number: 346

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Conditional operator(?) with function.\n", - "\n", - "import sys\n", - "\n", - "#Function Definitions\n", - "def sqr(x):\n", - " sys.stdout.write(\"Square \")\n", - " return pow(x,2)\n", - "\n", - "def cube(x):\n", - " sys.stdout.write(\"Cube \")\n", - " return pow(x,3)\n", - "\n", - "def y():\n", - " return 10\n", - "\n", - "#Variable Initialization\n", - "x = int(raw_input(\"Enter a Number : \"))\n", - "\n", - "#Function call\n", - "z = sqr(x) if x > y() else cube(x)\n", - "\n", - "#Result\n", - "sys.stdout.write(\" = %d\"%(z))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number : 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Cube = 125" - ] - } - ], - "prompt_number": 18 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.29, Page number: 346

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#compare two return values of functions\n", - "\n", - "import sys\n", - "\n", - "#Function Definitions\n", - "def a():\n", - " x = int(raw_input(\"Enter a Number a() : \"))\n", - " return x\n", - "\n", - "def b():\n", - " x = int(raw_input(\"Enter a Number b() : \"))\n", - " return x\n", - "\n", - "#Function call and Result\n", - "if a() == b():\n", - " sys.stdout.write(\"\\nValue of a() & b() are equal\")\n", - "else:\n", - " sys.stdout.write(\"\\nValue of a() & b() are unique\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number a() : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number b() : 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Value of a() & b() are equal" - ] - } - ], - "prompt_number": 19 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.30, Page number: 347

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Evaluate the equation s = sqr(a() + b()) using function\n", - "\n", - "import sys\n", - "\n", - "#Function Definitions\n", - "def a():\n", - " a = int(raw_input(\"Enter value of a : \"))\n", - " return a\n", - "\n", - "def b():\n", - " b = int(raw_input(\"Enter value of b : \"))\n", - " return b\n", - "\n", - "def sqr(x):\n", - " return x*x\n", - "\n", - "#Function call\n", - "s = sqr(a() + b())\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nSquare of Sum = %d\"%(s))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter value of a : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter value of b : 3\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Square of Sum = 64" - ] - } - ], - "prompt_number": 20 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.31, Page number: 348

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Evaluate the equation y = x^1+x^2..x^n using function\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def b(m):\n", - " m += 1\n", - " #sys.stdout.write(\"%d\"%(m))\n", - " return m\n", - "\n", - "#Variable Initialization\n", - "x = int(raw_input(\"Values of 'x' and 'n' : \"))\n", - "n = int(raw_input(\"Values of 'x' and 'n' : \"))\n", - "y = 0\n", - "z = 1\n", - "m = 0\n", - "\n", - "while(z <= n):\n", - " m = b(m)\n", - " y = y + pow(x,m)\n", - " sys.stdout.write(\"%d + \"%(y))\n", - " z += 1\n", - " \n", - "if z >= n:\n", - " sys.stdout.write(\"\\nValue of y = %d\"%(y))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Values of 'x' and 'n' : 3\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Values of 'x' and 'n' : 3\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "3 + 12 + 39 + \n", - "Value of y = 39" - ] - } - ], - "prompt_number": 21 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.32, Page number: 350

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call user defined function through if statement\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def a():\n", - " a = int(raw_input(\"Enter value of a :\"))\n", - " return a\n", - "\n", - "#Function call and Result\n", - "if a()%2 == 0:\n", - " sys.stdout.write(\"\\nThe number is even.\")\n", - "else:\n", - " sys.stdout.write(\"\\nThe number is odd.\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter value of a :5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "The number is odd." - ] - } - ], - "prompt_number": 22 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.33, Page number: 351

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call user defined function through switch() statement\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def a():\n", - " c = raw_input(\"Enter Your Choice Square(s), Cube(c), Double(d) : \")\n", - " c = c.lower()\n", - " return c\n", - "\n", - "#Variable Initialization\n", - "x = 5\n", - "\n", - "#There is no switch() statement in python.\n", - "c = a()\n", - "if c == 's':\n", - " sys.stdout.write(\"\\nSquare of %d is %d\"%(x,pow(x,2)))\n", - "else:\n", - " if c == 'c':\n", - " sys.stdout.write(\"\\nCube of %d is %d\"%(x,pow(x,3)))\n", - " else:\n", - " if c == 'd':\n", - " sys.stdout.write(\"\\nDouble of %d is %d\"%(x,x*2))\n", - " else:\n", - " sys.stdout.write(\"\\nUnexpected Choice printed as it is : %d\"%(x))\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Your Choice Square(s), Cube(c), Double(d) : D\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Double of 5 is 10" - ] - } - ], - "prompt_number": 23 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.34, Page number: 353

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call function through the for loop\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def plus(k):\n", - " if k == 10:\n", - " return 0\n", - " else:\n", - " return k\n", - " \n", - "#Variable Initialization\n", - "m = 1\n", - "\n", - "#Function call & Result\n", - "#in python, for loop iterates through a range of number. so while loop is used instead.\n", - "while plus(m) != 0:\n", - " sys.stdout.write(\"%3d\"%(m))\n", - " m += 1\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " 1 2 3 4 5 6 7 8 9" - ] - } - ], - "prompt_number": 14 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.35, Page number: 354

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call user defined function through while() loop\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def y():\n", - " x = int(raw_input(\"Enter a Number : \"))\n", - " return x\n", - "\n", - "#Function call & Result\n", - "while y() != 0:\n", - " sys.stdout.write(\"Value enter is non-zero\\n\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number : 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Value enter is non-zero\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number : 0\n" - ] - } - ], - "prompt_number": 25 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.36, Page number: 355

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call user defined function through do while() loop\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def y():\n", - " x = int(raw_input(\"Enter a Number : \"))\n", - " return x\n", - "\n", - "#Function call and Result\n", - "#There is no do-while loop in python\n", - "\n", - "while y() != 0:\n", - " sys.stdout.write(\"\\nValue entered is non-zero\\n\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number : 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Value entered is non-zero\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number : 0\n" - ] - } - ], - "prompt_number": 27 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.37, Page number: 356

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Initialize an array using functions.\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def c(m):\n", - " n = int(raw_input(\"Enter Number d[%d]\"%(m+1)))\n", - " return n\n", - "\n", - "#Variable Initialization\n", - "d = [c(i) for i in range(0,5)]\n", - "\n", - "sys.stdout.write(\"\\nArray d[] elements are : \")\n", - "for k in range(0,5):\n", - " sys.stdout.write(\"%2d\"%d[k])" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Number d[1]4\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Number d[2]5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Number d[3]6\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Number d[4]7\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Number d[5]8\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Array d[] elements are : 4 5 6 7 8" - ] - } - ], - "prompt_number": 28 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.38, Page number: 357

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Pass array element to the function using call by value method.\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def show(m,u):\n", - " sys.stdout.write(\"\\nnum[%d] = %d\"%(m+1,u))\n", - " \n", - "#Variable initialization\n", - "num = [12,13,14,15,16,17,18]\n", - "\n", - "#Function call & Result\n", - "for k in range(0,7):\n", - " show(k,num[k])" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "num[1] = 12\n", - "num[2] = 13\n", - "num[3] = 14\n", - "num[4] = 15\n", - "num[5] = 16\n", - "num[6] = 17\n", - "num[7] = 18" - ] - } - ], - "prompt_number": 20 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.39, Page number: 358

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Pass array element to the function using call by reference\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def show(u):\n", - " m = 0\n", - " sys.stdout.write(\"\\nnum[7] = {\")\n", - " while m != 7:\n", - " #There is no pointer concept in python\n", - " sys.stdout.write(\"%2d,\"%(u[m]))\n", - " m += 1\n", - " sys.stdout.write(\"\\b}\")\n", - " \n", - "#Variable Initialization\n", - "num = [12,13,14,15,16,17,18]\n", - "\n", - "#Function call\n", - "show(num)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "num[7] = {12,13,14,15,16,17,18,\b}" - ] - } - ], - "prompt_number": 22 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.40, Page number: 359

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Array elements in reverse order.\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def show(u):\n", - " m = 6\n", - " while m != -1:\n", - " sys.stdout.write(\"\\nnum[%d] = %d\"%(m,u[m]))\n", - " m -= 1\n", - " \n", - "#Variable Initialization\n", - "num = [12,13,14,15,16,17,18]\n", - "\n", - "#Function call\n", - "#There is no pointer concept in python\n", - "show(num)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "num[6] = 18\n", - "num[5] = 17\n", - "num[4] = 16\n", - "num[3] = 15\n", - "num[2] = 14\n", - "num[1] = 13\n", - "num[0] = 12" - ] - } - ], - "prompt_number": 23 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.41, Page number: 360

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Copy array elements using user defined function.\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def cpy(p,m):\n", - " j = 0\n", - " while j != 5:\n", - " m[j] = p[j]\n", - " j += 1\n", - " \n", - "#Variable Initialization\n", - "a1 = [1,2,3,4,5]\n", - "a2 = [0 for i in range(0,5)]\n", - "\n", - "#Function call\n", - "cpy(a1,a2)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"Source Target\")\n", - "for h in range(0,5):\n", - " sys.stdout.write(\"\\n%5d\\t%d\"%(a1[h],a2[h]))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Source Target\n", - " 1\t1\n", - " 2\t2\n", - " 3\t3\n", - " 4\t4\n", - " 5\t5" - ] - } - ], - "prompt_number": 24 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.42, Page number: 361

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read array of other function in main()\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def arry(k):\n", - " b = [1,2,3,4,5]\n", - " return b[k]\n", - "\n", - "#main() function\n", - "for k in range(0,5):\n", - " sys.stdout.write(\"\\t%d\"%(arry(k)))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\t1\t2\t3\t4\t5" - ] - } - ], - "prompt_number": 29 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.43, Page number: 361

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Interchange array elements of two arrays using function.\n", - "\n", - "import sys\n", - "global a\n", - "global b\n", - "\n", - "#Function Definitions\n", - "def read():\n", - " x = int(raw_input(\"\"))\n", - " return x\n", - "\n", - "def change(a,b):\n", - "#Since there is no pointer concept in python, exchange is done in the function using global variables.\n", - " for x in range(0,5):\n", - " a[x] = a[x] + b[x]\n", - " b[x] = a[x] - b[x]\n", - " a[x] = a[x] - b[x]\n", - " \n", - "#Variable Initialization\n", - "a = [0 for i in range(0,5)]\n", - "b = [0 for i in range(0,5)]\n", - "\n", - "for x in range(0,10):\n", - " if x < 5:\n", - " a[x] = read()\n", - " else:\n", - " b[x-5] = read()\n", - "\n", - "#Swapping and Result\n", - "sys.stdout.write(\"\\nArray A & B \")\n", - "\n", - "for x in range(0,5):\n", - " sys.stdout.write(\"\\n%7d%8d\"%(a[x],b[x]))\n", - " \n", - "#There is no pointer concept in python.\n", - "change(a,b)\n", - " \n", - "sys.stdout.write(\"\\nNow A & B\")\n", - "for x in range(0,5):\n", - " sys.stdout.write(\"\\n%7d%8d\"%(a[x],b[x]))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "1\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "2\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "3\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "4\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "6\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "7\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "8\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "9\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "0\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Array A & B \n", - " 1 6\n", - " 2 7\n", - " 3 8\n", - " 4 9\n", - " 5 0\n", - "Now A & B\n", - " 6 1\n", - " 7 2\n", - " 8 3\n", - " 9 4\n", - " 0 5" - ] - } - ], - "prompt_number": 30 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.44, Page number: 363

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read array elements declared in different functions using global\n", - "#pointer declaration\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def call(j):\n", - " m = 0\n", - " u = [5,1,6,0,6]\n", - " q = u\n", - " while m != j:\n", - " sys.stdout.write(\"%3d\"%(u[m]))\n", - " m += 1\n", - " sys.stdout.write(\"\\n\")\n", - " \n", - "#Variable Initialization\n", - "m = 0\n", - "k = [3,8,5,2,5]\n", - "q = k\n", - "\n", - "\n", - "\n", - "#Result\n", - "while m != 5:\n", - " sys.stdout.write(\"%3d\"%(q[m]))\n", - " m += 1\n", - "\n", - "sys.stdout.write(\"\\n\")\n", - "call(5)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " 3 8 5 2 5\n", - " 5 1 6 0 6\n" - ] - } - ], - "prompt_number": 30 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.45, Page number: 364

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Sum of 1 to 5 numbers using recursion\n", - "\n", - "import sys\n", - "global s\n", - "\n", - "s = 0\n", - "#Function definition\n", - "def main(x,s):\n", - " s = s + x\n", - " sys.stdout.write(\"\\nx = %d s = %d\"%(x,s))\n", - " if x == 5:\n", - " return\n", - " x += 1\n", - " main(x,s)\n", - " \n", - "main(1,s)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "x = 1 s = 1\n", - "x = 2 s = 3\n", - "x = 3 s = 6\n", - "x = 4 s = 10\n", - "x = 5 s = 15" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.46, Page number: 365

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Calculate triangular number of a given number with recursion function method\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def tri_num(m):\n", - " f = 0\n", - " if m == 0:\n", - " return f\n", - " else:\n", - " f = f + m + tri_num(m-1)\n", - " return f\n", - "\n", - "#Variable Initialization\n", - "n = int(raw_input(\"Enter a Number : \"))\n", - "\n", - "#Function call\n", - "t = tri_num(n)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nTriangular number of %d is %d\"%(n,t))\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number : 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Triangular number of 5 is 15" - ] - } - ], - "prompt_number": 31 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.47, Page number: 366

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the given string using recursion\n", - "\n", - "import sys\n", - "import os\n", - "global x\n", - "\n", - "#Variable Initialization\n", - "x = 0\n", - "str1 = \"Have a Good Day\"\n", - "\n", - "#Function Definition\n", - "def main(x):\n", - " if x == len(str1): #There is no null terminating character in python string\n", - " return\n", - " else:\n", - " if str1[x] == 'H':\n", - " os.system('cls')\n", - " sys.stdout.write(\"%c\"%(str1[x]))\n", - " else:\n", - " sys.stdout.write(\"%c\"%(str1[x]))\n", - " x += 1\n", - " main(x)\n", - " \n", - "#Function call\n", - "main(x)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Have a Good Day" - ] - } - ], - "prompt_number": 47 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.48, Page number: 367

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the given string 10 times using recursion\n", - "\n", - "import sys\n", - "import os\n", - "\n", - "#Function definition\n", - "def main(x):\n", - " sys.stdout.write(\"\\n%.2d] %s\"%(x,str1))\n", - " x += 1\n", - " if x == 11:\n", - " return\n", - " else:\n", - " if x == 1:\n", - " os.system('cls')\n", - " main(x)\n", - " else:\n", - " main(x)\n", - " \n", - " \n", - "#Variable Initialization\n", - "x = 0\n", - "str1 = \"Have a Good Day\"\n", - "\n", - "#Function call\n", - "main(x)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "00] Have a Good Day\n", - "01] Have a Good Day" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "02] Have a Good Day\n", - "03] Have a Good Day\n", - "04] Have a Good Day\n", - "05] Have a Good Day\n", - "06] Have a Good Day\n", - "07] Have a Good Day\n", - "08] Have a Good Day\n", - "09] Have a Good Day\n", - "10] Have a Good Day" - ] - } - ], - "prompt_number": 51 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.49, Page number: 368

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Factorial using recursive function.\n", - "\n", - "import sys\n", - "\n", - "#Function Definition\n", - "def fact(m):\n", - " f = 1\n", - " if m == 1:\n", - " return 1\n", - " else:\n", - " f = m * fact(m-1)\n", - " return f\n", - " \n", - "#Variable Initialization\n", - "x = int(raw_input(\"Enter a Number : \"))\n", - "\n", - "#Function call\n", - "f = fact (x)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nFactorial of %d is %d\"%(x,f))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a Number : 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Factorial of 5 is 120" - ] - } - ], - "prompt_number": 32 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.50, Page number: 369

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display address of user defined function\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def show():\n", - " sys.stdout.write(\"\\nAddress of function show() is : \")\n", - " \n", - "#Function call\n", - "show()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"%u\"%(id(show)))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Address of function show() is : 95041520" - ] - } - ], - "prompt_number": 54 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.51, Page number: 369

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call function using pointer\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def show():\n", - " sys.stdout.write(\"\\nAddress of function show() is : \")\n", - " \n", - "#There is no pointer concept in python\n", - "p = id(show)\n", - "show()\n", - "sys.stdout.write(\"%u\"%(id(show)))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Address of function show() is : 95041200" - ] - } - ], - "prompt_number": 55 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.52, Page number: 370

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the address of library function.\n", - "\n", - "import sys\n", - "import os\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nAddress of printf() is %u\"%(id(sys.stdout.write)))\n", - "sys.stdout.write(\"\\nAddress of scanf() is %u\"%(id(sys.stdout.read)))\n", - "sys.stdout.write(\"\\nAddress of clrscr() is %u\"%(id(os.system('cls'))))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Address of printf() is 60743848\n", - "Address of scanf() is 60743848\n", - "Address of clrscr() is 4774132" - ] - } - ], - "prompt_number": 57 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 10.53, Page number: 371

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Call main() using pointer to main() function\n", - "\n", - "import sys\n", - "\n", - "#Variable Initilization\n", - "x = 0\n", - "\n", - "#Function definition\n", - "def main(x):\n", - " p = id(main)\n", - " x += 1\n", - " sys.stdout.write(\"\\nCall %d Address of main() %u\"%(x,id(main)))\n", - " if x == 3:\n", - " return\n", - " main(x)\n", - " \n", - "#function call\n", - "main(x)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Call 1 Address of main() 95040880\n", - "Call 2 Address of main() 95040880\n", - "Call 3 Address of main() 95040880" - ] - } - ], - "prompt_number": 59 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter11.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter11.ipynb deleted file mode 100755 index c8fac375..00000000 --- a/Programming_in_C_using_ANSI_C/KamthaneChapter11.ipynb +++ /dev/null @@ -1,446 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Chapter 11: Storage Class

" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.1, Page number: 376

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Working of auto variable\n", - "\n", - "import sys\n", - "\n", - "#Functio definitions\n", - "def call1():\n", - " v = 20\n", - " sys.stdout.write(\"\\nV = %d\"%(v))\n", - " \n", - "def call2():\n", - " v = 30\n", - " call1()\n", - " sys.stdout.write(\"\\nV = %d\"%(v))\n", - " \n", - "#Variable Initialization\n", - "v = 10\n", - "\n", - "#Function call\n", - "call2()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nV = %d\"%(v))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "V = 20\n", - "V = 30\n", - "V = 10" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.2, Page number: 376

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Working of auto variables in different blocks\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "x = 10\n", - "\n", - "sys.stdout.write(\"\\nX = %d\"%(x))\n", - "\n", - "x = 20\n", - "sys.stdout.write(\"\\nX = %d\"%(x))\n", - "\n", - "x = 10\n", - "sys.stdout.write(\"\\nX = %d\"%(x))\n", - "\n", - "#In python, block of statements are indicated using intendation.\n", - "#block of statements can be written for conditional,loop or function statements" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "X = 10\n", - "X = 20\n", - "X = 10" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.3, Page number: 377

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Use same variable in different blocks with different data types\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization & Result\n", - "x = 10\n", - "sys.stdout.write(\"\\nX = %d\"%(x))\n", - "\n", - "x = 2.22\n", - "sys.stdout.write(\"\\nX = %g\"%(x))\n", - "\n", - "x = \"Auto Storage Class\"\n", - "sys.stdout.write(\"\\nX = %s\"%(x))\n", - "\n", - "x = 10\n", - "sys.stdout.write(\"\\nX = %d\"%(x))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "X = 10\n", - "X = 2.22\n", - "X = Auto Storage Class\n", - "X = 10" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.4, Page number: 378

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Working of external variables\n", - "\n", - "import sys\n", - "\n", - "#Function definitions\n", - "def call1():\n", - " sys.stdout.write(\"\\nIn Call1() V = %d\"%(v))\n", - " \n", - "def call2():\n", - " sys.stdout.write(\"\\nIn call2() V = %d\"%(v))\n", - " \n", - "#Variable Initialization\n", - "global v\n", - "v = 10\n", - "\n", - "call1()\n", - "call2()\n", - "sys.stdout.write(\"\\nIn main() V = %d\"%(v))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "In Call1() V = 10\n", - "In call2() V = 10\n", - "In main() V = 10" - ] - } - ], - "prompt_number": 8 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.5, Page number: 379

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Working of auto and global variables with same name\n", - "\n", - "import sys\n", - "\n", - "#Function definitions\n", - "def call1():\n", - " v = 20\n", - " sys.stdout.write(\"\\nIn Call1() V = %d\"%(v))\n", - " \n", - "def call2():\n", - " sys.stdout.write(\"\\nIn call2() V = %d\"%(v))\n", - " \n", - "#Variable Initialization\n", - "global v\n", - "v = 10\n", - "\n", - "#Function call\n", - "call1()\n", - "call2()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nIn main() V = %d\"%(v))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "In Call1() V = 20\n", - "In call2() V = 10\n", - "In main() V = 10" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.6, Page number: 380

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Declare external variables using extern keyword\n", - "\n", - "#Variable Initialization\n", - "global m\n", - "m = 10\n", - "\n", - "#There is no extern keyword in python, global is used instead\n", - "sys.stdout.write(\"\\nM = %d\"%(m))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "M = 10" - ] - } - ], - "prompt_number": 10 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.7, Page number: 380

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Use of static variable\n", - "\n", - "import sys\n", - "\n", - "#Function definition\n", - "def print1(m):\n", - " sys.stdout.write(\"\\nm = %d\"%(m))\n", - " if m == 3:\n", - " return\n", - " \n", - "m = 0\n", - "\n", - "for i in range(0,3):\n", - " m += 1\n", - " print1(m)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "m = 1\n", - "m = 2\n", - "m = 3" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.8, Page number: 381

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Difference between variables of auto and static class\n", - "\n", - "import sys\n", - "\n", - "#Result\n", - "y = 0\n", - "sys.stdout.write(\"\\nx = %d & y = %d\"%(x,y))\n", - "\n", - "#Since x display the junk value which stored already, it differs in different systems" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "x = 10 & y = 0" - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.9, Page number: 382

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Register class variable\n", - "\n", - "import sys\n", - "\n", - "#There is no register keyword in python\n", - "m = 1\n", - "\n", - "#Result\n", - "for m in range(1,5+1):\n", - " sys.stdout.write(\"\\t%d\"%(m))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\t1\t2\t3\t4\t5" - ] - } - ], - "prompt_number": 18 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 11.10, Page number: 382

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Register class variable\n", - "\n", - "import sys\n", - "\n", - "#There is no register class variable in python\n", - "m = 1\n", - "\n", - "for m in range(1,6):\n", - " sys.stdout.write(\"\\t%d\"%(m))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\t1\t2\t3\t4\t5" - ] - } - ], - "prompt_number": 19 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter12.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter12.ipynb deleted file mode 100755 index e1acaa2c..00000000 --- a/Programming_in_C_using_ANSI_C/KamthaneChapter12.ipynb +++ /dev/null @@ -1,849 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Chapter 12: Preprocessor Directives

" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.1, Page number: 386

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Area of circle\n", - "\n", - "import sys\n", - "\n", - "#Defining the macro\n", - "#There is no macro definitions/preprocessors in python\n", - "PI = 3.14\n", - "\n", - "#Variable Initialization\n", - "r = float(raw_input(\"Enter radius of circle in cms.\"))\n", - "\n", - "#Calculation\n", - "area = PI * r * r\n", - "\n", - "#Result\n", - "sys.stdout.write(\"Area of a Circle = %.2f cm2\"%(area))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter radius of circle in cms.7\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Area of a Circle = 153.86 cm2" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.2, Page number: 387

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Identifers for 'c' statements and variables\n", - "\n", - "import sys\n", - "import os\n", - "\n", - "#Macro definitions\n", - "#in python, function definitions are used instead of macros\n", - "def N():\n", - " return 10\n", - "\n", - "def cls():\n", - " os.system('cls')\n", - " \n", - "def wait():\n", - " t = raw_input(\"\")\n", - " \n", - "def display(s):\n", - " sys.stdout.write(s)\n", - "\n", - "for k in range(1,N()+1):\n", - " display(\"%d\\t\"%(k))\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.3, Page number: 387

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Macros for logical operators\n", - "\n", - "import sys\n", - "\n", - "#Macro definitions\n", - "#in python, function definitions are used as macros\n", - "\n", - "#There is no preprocessors in python\n", - "\n", - "#Variable Initialization\n", - "a = int(raw_input(\"Enter Three Numbers : \"))\n", - "b = int(raw_input(\"Enter Three Numbers : \"))\n", - "c = int(raw_input(\"Enter Three Numbers : \"))\n", - "\n", - "if a > b and a > c:\n", - " sys.stdout.write(\"%d is the larger number\"%(a))\n", - "else:\n", - " if b > a and b > c:\n", - " sys.stdout.write(\"%d is the larger number\"%(b))\n", - " else:\n", - " if c > a and c > b:\n", - " sys.stdout.write(\"%d is the larger number\"%(c))\n", - " else:\n", - " if a == b and b == c:\n", - " sys.stdout.write(\"\\nNumbers are same.\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Numbers : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Numbers : 4\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Three Numbers : 7\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "7 is the larger number" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.4, Page number: 388

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Identifier for displaying double and triple of a number.\n", - "\n", - "#Macro definitions\n", - "#Function definitions are used as macros in python\n", - "\n", - "def DOUBLE(a):\n", - " return a*2\n", - "\n", - "def TRIPLE(a):\n", - " return a*3\n", - "\n", - "#Variable initialization\n", - "a = 1\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nSINGLE\\tDOUBLE\\tTRIPLE\")\n", - "\n", - "for a in range(1,5+1):\n", - " sys.stdout.write(\"\\n%d\\t%d\\t%d\"%(a,DOUBLE(a),TRIPLE(a)))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "SINGLE\tDOUBLE\tTRIPLE\n", - "1\t2\t3\n", - "2\t4\t6\n", - "3\t6\t9\n", - "4\t8\t12\n", - "5\t10\t15" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.5, Page number: 389

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Undefine a macro\n", - "\n", - "#There is no preprocessor directives in python\n", - "\n", - "def wait():\n", - " return (raw_input(\"\"))\n", - "\n", - "#Result\n", - "for k in range(1,5+1):\n", - " sys.stdout.write(\"%d\\t\"%(k))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "1\t2\t3\t4\t5\t" - ] - } - ], - "prompt_number": 14 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.6, Page number: 389

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Stringizing operation\n", - "\n", - "#Macro definition\n", - "#in python, function definition can be used as macro\n", - "\n", - "def say(m):\n", - " sys.stdout.write(m)\n", - " \n", - "#Function call\n", - "say(\"Hello\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Hello" - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.7, Page number: 390

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Stringizing operation and macro arguments\n", - "\n", - "#There is no macro in python, function definitions can be used as macros\n", - "\n", - "def DOUBLE(x):\n", - " sys.stdout.write(\"Double of m = %d\\n\"%(x*2))\n", - " \n", - "def TRIPLE(x):\n", - " sys.stdout.write(\"Triple of m = %d\\n\"%(x*3))\n", - " \n", - "#Variable Initialization\n", - "m = int(raw_input(\"Enter a number : \"))\n", - "\n", - "#Function call & Result\n", - "DOUBLE(m)\n", - "TRIPLE(m)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a number : 5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Double of m = 10\n", - "Triple of m = 15\n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.8, Page number: 390

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Larger of two numbers using macro with arguments.\n", - "\n", - "import sys\n", - "\n", - "#Macro definition //function definition itself is used as macro\n", - "def MAX(x,y):\n", - " if x > y:\n", - " c = x\n", - " else:\n", - " c = y\n", - " return c\n", - "\n", - "#Variable Initialization\n", - "x = 5\n", - "y = 8\n", - "\n", - "#Function call\n", - "c = MAX(x,y)\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nLarger of two numbers = %d\"%(c))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Larger of two numbers = 8" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.9, Page number: 391

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Function defined in \"udf.c\" file.\n", - "\n", - "import sys\n", - "#since ipython notebook does not support this function, function is used\n", - "#in python, the udf.c file can be written and saved in udf.py and import command\n", - "#can be used to include that file in this program\n", - "\n", - "def display():\n", - " sys.stdout.write(\"\\nFunction Called\")\n", - " \n", - "#Function call\n", - "display()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Function Called" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.10, Page number: 392

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Conditional compilation \n", - "\n", - "import sys\n", - "\n", - "#There is no preprocessor directives in python\n", - "\n", - "LINE = 1\n", - "\n", - "if LINE:\n", - " sys.stdout.write(\"This is line number one\")\n", - "else:\n", - " sys.stdout.write(\"This is line number two\")\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "This is line number one" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.11, Page number: 393

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Conditional compilation \n", - "import sys\n", - "\n", - "#There is no preprocessor directives in python\n", - "def E():\n", - " return 1\n", - "\n", - "#Function call\n", - "if E():\n", - " a = 2\n", - " b = 3\n", - " sys.stdout.write(\"A = %d & B = %d\"%(a,b))\n", - "else:\n", - " c = 2\n", - " d = 3\n", - " sys.stdout.write(\"C = %d & D = %d\"%(c,d))\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "A = 2 & B = 3" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.12, Page number: 394

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Conditional compilation directives \n", - "\n", - "import sys\n", - "\n", - "#There is no preprocessor directives in python\n", - "T = 8\n", - "\n", - "#Result\n", - "if T == 0:\n", - " sys.stdout.write(\"\\nMacro is not defined.\")\n", - "else:\n", - " sys.stdout.write(\"\\nMacro is defined\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Macro is defined" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.13, Page number: 394

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#User defined error message \n", - "\n", - "import sys\n", - "\n", - "#There is no preprocessor directives in python\n", - "B = 1\n", - "A = 0\n", - "\n", - "#Result\n", - "if A == 0:\n", - " sys.stdout.write(\"MACRO A IS NOT DEFINED.\")\n", - "else:\n", - " sys.stdout.write(\"Macro found.\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "MACRO A IS NOT DEFINED." - ] - } - ], - "prompt_number": 14 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.14, Page number: 397

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Set off certain errors \n", - "\n", - "import sys\n", - "\n", - "#There is no preprocessor directives in python\n", - "x = 2\n", - "y = 1\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\ny = %d\"%(y))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "y = 1" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.15, Page number: 398

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Predefined macros \n", - "\n", - "import sys\n", - "import datetime\n", - "\n", - "#Variable Initialization\n", - "FILE = 'PRE_MA~1.C'\n", - "LINE = 10\n", - "STDC = 1\n", - "\n", - "#Date/time can be set using datetime.date(2001,5,12)\n", - "#Result\n", - "sys.stdout.write(\"\\nDATE : %s\"%('Dec 05 2001')) \n", - "sys.stdout.write(\"\\nTIME : %s\"%(datetime.time(21,7,39)))\n", - "sys.stdout.write(\"\\nFILE NAME : %s\"%(FILE))\n", - "sys.stdout.write(\"\\nLINE NO : %d\"%(LINE))\n", - "sys.stdout.write(\"\\n_STDC_ : %x\"%(STDC))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "DATE : Dec 05 2001\n", - "TIME : 21:07:39\n", - "FILE NAME : PRE_MA~1.C\n", - "LINE NO : 10\n", - "_STDC_ : 1" - ] - } - ], - "prompt_number": 31 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.16, Page number: 399

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the name of memory model that is currently in use.\n", - "\n", - "import sys\n", - "\n", - "#There is no formal memory model and preprocessor directives in python\n", - "\n", - "TINY = 0\n", - "SMALL = 0\n", - "MEDIUM = 0\n", - "COMPACT = 0\n", - "LARGE = 1\n", - "HUGE = 0\n", - "\n", - "#Result\n", - "if TINY:\n", - " sys.stdout.write(\"\\nTINY %d\"%(TINY))\n", - "else:\n", - " if SMALL:\n", - " sys.stdout.write(\"\\nSMALL %d\"%(SMALL))\n", - " else:\n", - " if MEDIUM:\n", - " sys.stdout.write(\"\\nMEDIUM %d\"%(MEDIUM))\n", - " else:\n", - " if COMPACT:\n", - " sys.stdout.write(\"\\nCOMPACT %d\"%(COMPACT))\n", - " else:\n", - " if LARGE:\n", - " sys.stdout.write(\"\\nLARGE %d\"%(LARGE))\n", - " else:\n", - " sys.stdout.write(\"\\nHUGE %d\"%(HUGE))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "LARGE 1" - ] - } - ], - "prompt_number": 32 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.17, Page number: 400

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Macro expansions\n", - "\n", - "import sys\n", - "\n", - "#There is no preprocessor directives in python\n", - "ch = raw_input(\"Input a Text : \")\n", - "\n", - "#Result\n", - "sys.stdout.write(\"Text Input : %s\"%(ch))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Input a Text : Programming\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Text Input : Programming" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 12.18, Page number: 401

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Predefined macros.\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "d = raw_input(\"Enter any character : \")\n", - "\n", - "#Result\n", - "f = d.isalpha()\n", - "\n", - "if f != 0:\n", - " sys.stdout.write(\"\\n%c is a letter in\"%(d))\n", - " f = d.isupper()\n", - " if f != 0:\n", - " sys.stdout.write(\" Capital case\")\n", - " else:\n", - " sys.stdout.write(\" Small case\")\n", - "else:\n", - " f = d.isdigit()\n", - " if f != 0:\n", - " sys.stdout.write(\"\\n%c is a digit\"%(d))\n", - " else:\n", - " f = d.ispunct()\n", - " if f != 0:\n", - " sys.stdout.write(\"\\n%c is a punctuation symbol\"%(d))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter any character : C\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "C is a letter in Capital case" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter13.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter13.ipynb deleted file mode 100755 index f9222003..00000000 --- a/Programming_in_C_using_ANSI_C/KamthaneChapter13.ipynb +++ /dev/null @@ -1,2367 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Chapter 13: Structure and Union

" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.1, Page number: 409

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display size of structure elements\n", - "\n", - "import sys\n", - "\n", - "#Class is used instead of structure in python\n", - "class book1:\n", - " book = ''\n", - " pages = 0\n", - " price = 0.00\n", - "\n", - "#Python variables uses value tagged methods for storing the values\n", - "\n", - "#Class variable declaration\n", - "bk1 = book1()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nSize of Structure Elements\")\n", - "sys.stdout.write(\"\\nBook : %d\"%(sys.getsizeof(bk1.book)))\n", - "sys.stdout.write(\"\\nPages : %d\"%(sys.getsizeof(bk1.pages)))\n", - "sys.stdout.write(\"\\nPrice : %d\"%(sys.getsizeof(bk1.price)))\n", - "sys.stdout.write(\"\\nTotal Bytes : %d\"%(sys.getsizeof(bk1)))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Size of Structure Elements\n", - "Book : 21\n", - "Pages : 12\n", - "Price : 16\n", - "Total Bytes : 36" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.2, Page number: 410

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Define a structure and initialize its member variables\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class book1:\n", - " book = ''\n", - " pages = 0\n", - " price = 0.0\n", - " \n", - "#Class variable declaration and Initialization\n", - "bk1 = book1()\n", - "bk1.book = \"C++\"\n", - "bk1.pages = 300\n", - "bk1.price = 285\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nBook Name : %s\"%(bk1.book))\n", - "sys.stdout.write(\"\\nNo. of Pages : %d\"%(bk1.pages))\n", - "sys.stdout.write(\"\\nBook Price : %d\"%(bk1.price))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Book Name : C++\n", - "No. of Pages : 300\n", - "Book Price : 285" - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.3, Page number: 411

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Copy structure elements from one object to another object\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class disk:\n", - " co = ''\n", - " type1 = 0.0\n", - " price = 0\n", - " \n", - "#Class variable declaration\n", - "d1 = disk()\n", - "d2 = disk()\n", - "d3 = disk()\n", - "\n", - "#Class variable initialization\n", - "d1.co = \"SONY\"\n", - "d1.type1 = 1.44\n", - "d1.price = 20\n", - "\n", - "#Copying\n", - "d2.co = d1.co\n", - "d2.type1 = d1.type1\n", - "d2.price = d1.price\n", - "\n", - "d3 = d2\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\n%s %g %d\"%(d1.co,d1.type1,d1.price))\n", - "sys.stdout.write(\"\\n%s %g %d\"%(d2.co,d2.type1,d2.price))\n", - "sys.stdout.write(\"\\n%s %g %d\"%(d3.co,d3.type1,d3.price))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "SONY 1.44 20\n", - "SONY 1.44 20\n", - "SONY 1.44 20" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.4, Page number: 412

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read values and assign them to structure variables\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class book1:\n", - " book = ''\n", - " pages = 0\n", - " price = 0.0\n", - " \n", - "#Class variable declaration\n", - "bk1 = book1()\n", - "\n", - "#Variable initialization\n", - "bk1.book = raw_input(\"Enter Book name,pages,price : \")\n", - "bk1.pages = int(raw_input(\"Enter Book name,pages,price : \"))\n", - "bk1.price = float(raw_input(\"Enter Book name, pages,price : \"))\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nBook Name : %s\"%(bk1.book))\n", - "sys.stdout.write(\"\\nNo. of Pages : %d\"%(bk1.pages))\n", - "sys.stdout.write(\"\\nBook Price : %d\"%(bk1.price))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Book name,pages,price : C\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Book name,pages,price : 500\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Book name, pages,price : 450\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Book Name : C\n", - "No. of Pages : 500\n", - "Book Price : 450" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.5, Page number: 414

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read and display car details\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class time:\n", - " second = 0\n", - " minute = 0\n", - " hour = 0\n", - " \n", - "class t:\n", - " carno = 0\n", - " st = time()\n", - " rt = time()\n", - " \n", - "#Class variable declaration\n", - "r1 = t()\n", - "\n", - "#Variable Initialization\n", - "r1.carno = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n", - "r1.st.hour = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n", - "r1.st.minute = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n", - "r1.st.second = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n", - "r1.rt.hour = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n", - "r1.rt.minute = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n", - "r1.rt.second = int(raw_input(\"Car No., Starting Time, Reaching Time :\"))\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nCar No. \\tStarting Time \\tReaching Time\\n\")\n", - "sys.stdout.write(\"%d\\t\"%(r1.carno))\n", - "sys.stdout.write(\"\\t%d:%d:%d\\t\\t\"%(r1.st.hour,r1.st.minute,r1.st.second))\n", - "sys.stdout.write(\"%d:%d:%d\"%(r1.rt.hour,r1.rt.minute,r1.rt.second))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No., Starting Time, Reaching Time :125\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No., Starting Time, Reaching Time :2\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No., Starting Time, Reaching Time :50\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No., Starting Time, Reaching Time :30\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No., Starting Time, Reaching Time :3\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No., Starting Time, Reaching Time :50\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No., Starting Time, Reaching Time :25\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Car No. \tStarting Time \tReaching Time\n", - "125\t\t2:50:30\t\t3:50:25" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.6, Page number: 415

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read and display the details of a person\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class name:\n", - " first = ''\n", - " second = ''\n", - " last = ''\n", - " \n", - "class b_date:\n", - " day = 0\n", - " month = 0\n", - " year = 0\n", - " \n", - "class data:\n", - " nm = name()\n", - " bt = b_date()\n", - " \n", - "#Class variable declaration\n", - "r1 = data()\n", - "\n", - "#Variable Initialization\n", - "r1.nm.first = raw_input(\"Enter Name (First/Second/Last)\")\n", - "r1.nm.second = raw_input(\"Enter Name (First/Second/Last)\")\n", - "r1.nm.last = raw_input(\"Enter Name (First/Second/Last)\")\n", - "r1.bt.day = int(raw_input(\"Enter Birth Date Day/Month/Year\"))\n", - "r1.bt.month = int(raw_input(\"Enter Birth Date Day/Month/Year\"))\n", - "r1.bt.year = int(raw_input(\"Enter Birth Date Day/Month/Year\"))\n", - "\n", - "#Result\n", - "sys.stdout.write(\"Name : %s %s %s\\n\"%(r1.nm.first,r1.nm.second,r1.nm.last))\n", - "sys.stdout.write(\"Birth Date : %d.%d.%d\"%(r1.bt.day,r1.bt.month,r1.bt.year))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Name (First/Second/Last)Ram\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Name (First/Second/Last)Sham\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Name (First/Second/Last)Pande\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Birth Date Day/Month/Year12\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Birth Date Day/Month/Year12\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Birth Date Day/Month/Year1980\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Name : Ram Sham Pande\n", - "Birth Date : 12.12.1980" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.7, Page number: 416

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Create array of structure objects\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class time:\n", - " second = 0\n", - " minute = 0\n", - " hour = 0\n", - " \n", - "class t:\n", - " carno = 0\n", - " st = time()\n", - " rt = time()\n", - " \n", - "#Class variable declaration\n", - "r1 = [t() for i in range(0,3)]\n", - "\n", - "#Variable Initialization\n", - "for k in range(0,3):\n", - " r1[k].carno = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n", - " r1[k].st.hour = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n", - " r1[k].st.minute = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n", - " r1[k].st.second = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n", - " r1[k].rt.hour = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n", - " r1[k].rt.minute = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n", - " r1[k].rt.second = int(raw_input(\"Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)\"))\n", - " \n", - "#Result\n", - "sys.stdout.write(\"\\nCar No.\\t\\tStarting Time\\tReaching Time\")\n", - "for k in range(0,3):\n", - " sys.stdout.write(\"\\n%d\\t\"%(r1[k].carno))\n", - " sys.stdout.write(\"\\t%d:%d:%d\\t\"%(r1[k].st.hour,r1[k].st.minute,r1[k].st.second))\n", - " sys.stdout.write(\"\\t%d:%d:%d\\t\"%(r1[k].rt.hour,r1[k].rt.minute,r1[k].rt.second))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)120\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)2\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)20\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)25\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)3\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)25\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)58\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)121\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)3\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)25\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)40\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)4\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)40\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)25\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)122\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)4\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)30\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)52\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)40\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Car No. Starting Time(hh:mm:ss),Reaching Time(hh:mm:ss)10\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Car No.\t\tStarting Time\tReaching Time\n", - "120\t\t4:30:52\t\t5:40:10\t\n", - "121\t\t4:30:52\t\t5:40:10\t\n", - "122\t\t4:30:52\t\t5:40:10\t" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.8, Page number: 417

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read and display student details\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class stud:\n", - " name = ''\n", - " rollno = 0\n", - " grade = ''\n", - " \n", - "#Class variable declaration\n", - "st = [stud() for i in range(0,3)]\n", - "\n", - "#Variable Initialization\n", - "k = 0 \n", - "while k < 3:\n", - " st[k].name = raw_input(\"Name :\")\n", - " st[k].rollno = int(raw_input(\"Roll No. :\"))\n", - " st[k].grade = raw_input(\"Grade : \")\n", - " k += 1\n", - " \n", - "#Result\n", - "k = 0\n", - "sys.stdout.write(\"\\nName \\tRollno \\tGrade\\n\")\n", - "while k < 3:\n", - " sys.stdout.write(\"\\n%s\\t%d\\t%s\"%(st[k].name,st[k].rollno,st[k].grade))\n", - " k += 1\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Name :Suresh\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Roll No. :125\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Grade : A\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Name :Mahesh\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Roll No. :126\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Grade : B\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Name :Rajesh\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Roll No. :127\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Grade : A\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Name \tRollno \tGrade\n", - "\n", - "Suresh\t125\tA\n", - "Mahesh\t126\tB\n", - "Rajesh\t127\tA" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.9, Page number: 419

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Pointer to structure \n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class book:\n", - " name = ''\n", - " author = ''\n", - " pages = 0\n", - " \n", - "#Class variable declaration\n", - "b1 = book()\n", - "\n", - "#Variable Initialization\n", - "b1.name = \"JAVA COMPLETE REFERENCE\"\n", - "b1.author = \"P.NAUGHTON\"\n", - "b1.pages = 886\n", - "\n", - "#There is no pointer concept in python\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\n%s by %s of %d pages\"%(b1.name,b1.author,b1.pages))\n", - "sys.stdout.write(\"\\n%s by %s of %d pages\"%(b1.name,b1.author,b1.pages))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "JAVA COMPLETE REFERENCE by P.NAUGHTON of 886 pages\n", - "JAVA COMPLETE REFERENCE by P.NAUGHTON of 886 pages" - ] - } - ], - "prompt_number": 27 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.10, Page number: 420

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Pointer as members of structure \n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class boy:\n", - " name = ''\n", - " age = 0\n", - " height = 0.0\n", - " \n", - "#Class variable declaration\n", - "sp = boy()\n", - "\n", - "#Variable Initialization\n", - "sp.name = \"Mahesh\"\n", - "sp.age = 20\n", - "sp.height = 5.40\n", - "\n", - "#There is no pointer concept in python\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nName = %s\"%(sp.name))\n", - "sys.stdout.write(\"\\nAge = %s\"%(sp.age))\n", - "sys.stdout.write(\"\\nHeight = %s\"%(sp.height))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Name = Mahesh\n", - "Age = 20\n", - "Height = 5.4" - ] - } - ], - "prompt_number": 28 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.11, Page number: 421

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Pointer as members of structure \n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class boy:\n", - " name = ''\n", - " age = 0\n", - " height = 0.0\n", - " \n", - "#Class variable declaration\n", - "b = boy()\n", - "\n", - "#Variable Initialization\n", - "nm = \"Somesh\"\n", - "ag = 20\n", - "ht = 5.40\n", - "\n", - "#There is no pointer concept in python\n", - "b.name = nm\n", - "b.age = ag\n", - "b.height = ht\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nName : %s\"%(b.name))\n", - "sys.stdout.write(\"\\nAge = %d\"%(b.age))\n", - "sys.stdout.write(\"\\nHeight = %.2g\"%(b.height))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Name : Somesh\n", - "Age = 20\n", - "Height = 5.4" - ] - } - ], - "prompt_number": 30 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.12, Page number: 422

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the contents of the structure using ordinary pointer\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class num:\n", - " a = 0\n", - " b = 0\n", - " c = 0\n", - "\n", - "#Class variable declaration\n", - "d = num()\n", - "\n", - "#Variable Initialization\n", - "d.a = 2\n", - "d.b = 3\n", - "d.c = 4\n", - "\n", - "#There is no pointer concept in python\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\na = %d\"%(d.a))\n", - "sys.stdout.write(\"\\nb = %d\"%(d.b))\n", - "sys.stdout.write(\"\\nc = %d\"%(d.c))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "a = 2\n", - "b = 3\n", - "c = 4" - ] - } - ], - "prompt_number": 32 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.13, Page number: 423

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Passing address of structure variable\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class book:\n", - " name = ''\n", - " author = ''\n", - " pages = 0\n", - " \n", - "#Class variable declaration and initialization\n", - "b1 = book()\n", - "b1.name = \"JAVA COMPLETE REFERENCE\"\n", - "b1.author = \"P.NAUGHTON\"\n", - "b1.pages = 886\n", - "\n", - "#Function definition\n", - "def show(b1):\n", - " sys.stdout.write(\"\\n%s by %s of %d pages\"%(b1.name,b1.author,b1.pages))\n", - "\n", - "#Function call\n", - "show(b1)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "JAVA COMPLETE REFERENCE by P.NAUGHTON of 886 pages" - ] - } - ], - "prompt_number": 34 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.14, Page number: 424

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Passing structure elements to function\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class boy:\n", - " name = ''\n", - " age = 0\n", - " wt = 0\n", - " \n", - "#Class variable declaration and initialization\n", - "b1 = boy()\n", - "b1.name = \"Amit\"\n", - "b1.age = 20\n", - "b1.wt = 25\n", - "\n", - "#Function definition\n", - "def print1(s,t,n):\n", - " sys.stdout.write(\"\\n%s %d %d\"%(s,t,n))\n", - " \n", - "#Function call\n", - "print1(b1.name,b1.age,b1.wt)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Amit 20 25" - ] - } - ], - "prompt_number": 36 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.15, Page number: 425

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Pass entire structure to user defined function\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class boy:\n", - " name = ''\n", - " age = 0\n", - " wt = 0\n", - " \n", - "#Class variable declaration and initialization\n", - "b1 = boy()\n", - "b1.name = \"Amit\"\n", - "b1.age = 20\n", - "b1.wt = 25\n", - "\n", - "#Function definition\n", - "def print1(b):\n", - " sys.stdout.write(\"\\n%s %d %d\"%(b.name,b.age,b1.wt))\n", - " \n", - "#Function call\n", - "print1(b1)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Amit 20 25" - ] - } - ], - "prompt_number": 37 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.16, Page number: 426

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#User defined data type \n", - "\n", - "import sys\n", - "\n", - "#There is no preprocessor directive in python\n", - "H = 60\n", - "\n", - "#There is no typedef function in python and no separate variable declaration is needed\n", - "hrs = int(raw_input(\"Enter Hours :\"))\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nMinutes = %d\"%(hrs*H))\n", - "sys.stdout.write(\"\\nSeconds = %d\"%(hrs*H*H))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Hours :2\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Minutes = 120\n", - "Seconds = 7200" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.17, Page number: 426

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#String data type\n", - "\n", - "import sys\n", - "\n", - "#There is no typedef function in python\n", - "a = \" Hello \"\n", - "b = raw_input(\"Enter Your Name : \")\n", - "\n", - "#Result\n", - "sys.stdout.write(\"%s %s\"%(a,b))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Your Name : KAMAL\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " Hello KAMAL" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.18, Page number: 427

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Create user defined data type from structure\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "#There is no typedef function in python\n", - "class struct:\n", - " name = ''\n", - " sex = ''\n", - " acno = 0\n", - " \n", - "#class variable declaration and initialization\n", - "employee = struct()\n", - "employee.name = \"Sanjay\"\n", - "employee.sex = \"M\"\n", - "employee.acno = 125\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nName\\tSex\\tA/c No.\\n\")\n", - "sys.stdout.write(\"%s\\t\"%(employee.name))\n", - "sys.stdout.write(\"%s\\t\"%(employee.sex))\n", - "sys.stdout.write(\"%s\\n\"%(employee.acno))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Name\tSex\tA/c No.\n", - "Sanjay\tM\t125\n" - ] - } - ], - "prompt_number": 44 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.19, Page number: 427

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Create user defined data type from structure\n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class struct:\n", - " name = ''\n", - " sex = ''\n", - " acno = 0\n", - " \n", - "#class Variable declaration and initialization\n", - "employee = [struct() for i in range(0,2)]\n", - "\n", - "for k in range(0,2):\n", - " employee[k].name = raw_input(\"Name of the Employee :\")\n", - " employee[k].sex = raw_input(\"Sex\")\n", - " employee[k].acno = raw_input(\"A/c No.\")\n", - " \n", - "#Result\n", - "sys.stdout.write(\"\\nName\\tSex\\tA/c No.\\n\")\n", - "for k in range(0,2):\n", - " sys.stdout.write(\"%s\\t\"%(employee[k].name))\n", - " sys.stdout.write(\"%s\\t\"%(employee[k].sex))\n", - " sys.stdout.write(\"%s\\n\"%(employee[k].acno))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Name of the Employee :AJAY\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "SexM\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "A/c No.122\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Name of the Employee :ANITA\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "SexF\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "A/c No.124\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Name\tSex\tA/c No.\n", - "AJAY\tM\t122\n", - "ANITA\tF\t124\n" - ] - } - ], - "prompt_number": 8 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.20, Page number: 429

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Structure containing the details of the employees\n", - "\n", - "import sys\n", - "\n", - "#There is no typedef function in python\n", - "\n", - "#Class definition\n", - "class struct:\n", - " first = ''\n", - " middle = ''\n", - " last = ''\n", - " city = ''\n", - " pincode = 0\n", - " \n", - "#Class variable declaration and initialization\n", - "person = [struct() for i in range(0,2)]\n", - "\n", - "for j in range(0,2):\n", - " person[j].first = raw_input(\"First Name :\")\n", - " person[j].middle = raw_input(\"Middle Name : \")\n", - " person[j].last = raw_input(\"Last Name : \")\n", - " person[j].city = raw_input(\"City & Pincode\")\n", - " person[j].pincode = int(raw_input(\"City & Pincode\"))\n", - " \n", - "#Result\n", - "for j in range(0,2):\n", - " sys.stdout.write(\"\\nRecord No : %d\"%(j+1))\n", - " sys.stdout.write(\"\\nFirst Name : %s\"%(person[j].first))\n", - " sys.stdout.write(\"\\nMiddle Name : %s\"%(person[j].middle))\n", - " sys.stdout.write(\"\\nLast Name : %s\"%(person[j].last))\n", - " sys.stdout.write(\"\\nCity & Pincode : %s - %d\\n\"%(person[j].city,person[j].pincode))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "First Name :Jay\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Middle Name : Mohan\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Last Name : Deshmukh\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "City & PincodeNanded\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "City & Pincode431602\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "First Name :Vijay\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Middle Name : Kamal\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Last Name : Nandedkar\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "City & PincodeNanded\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "City & Pincode431602\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Record No : 1\n", - "First Name : Jay\n", - "Middle Name : Mohan\n", - "Last Name : Deshmukh\n", - "City & Pincode : Nanded - 431602\n", - "\n", - "Record No : 2\n", - "First Name : Vijay\n", - "Middle Name : Kamal\n", - "Last Name : Nandedkar\n", - "City & Pincode : Nanded - 431602\n" - ] - } - ], - "prompt_number": 10 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.21, Page number: 431

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Information of vehicles\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "PETROL = 1\n", - "DISEL = 2\n", - "TWO_WH = 3\n", - "FOUR_WH = 4\n", - "OLD = 5\n", - "NEW = 6\n", - "\n", - "#Class declaration\n", - "class vehicle:\n", - " type1 = 3\n", - " fuel = 2\n", - " model = 3\n", - " \n", - "#Class variable declaration and initialization\n", - "v = vehicle()\n", - "v.type1 = FOUR_WH\n", - "v.fuel = DISEL\n", - "v.model = OLD\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nType of Vehicle : %d\"%(v.type1))\n", - "sys.stdout.write(\"\\nFuel : %d\"%(v.fuel))\n", - "sys.stdout.write(\"\\nModel : %d\"%(v.model))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Type of Vehicle : 4\n", - "Fuel : 2\n", - "Model : 5" - ] - } - ], - "prompt_number": 52 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.22, Page number: 432

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the examination result of the student \n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "#There is no preprocessor directives in python\n", - "PASS = 1\n", - "FAIL = 0\n", - "A = 0\n", - "B = 1\n", - "C = 2\n", - "\n", - "#Class declaration\n", - "class student:\n", - " name = ''\n", - " result = 1\n", - " grade = 2\n", - " \n", - "#Class variable declaration and initialization\n", - "v = student()\n", - "\n", - "v.name = \"Sachin\"\n", - "v.result = PASS\n", - "v.grade = C\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nName : %s\"%(v.name))\n", - "sys.stdout.write(\"\\nResult : %d\"%(v.result))\n", - "sys.stdout.write(\"\\nGrade : %d\"%(v.grade))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Name : Sachin\n", - "Result : 1\n", - "Grade : 2" - ] - } - ], - "prompt_number": 53 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.23, Page number: 433

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Enumerated data type for 12 months\n", - "\n", - "import sys\n", - "\n", - "#There is no enumerated data type in python and an alternate is to use class\n", - "#Class declaration\n", - "class month:\n", - " Jan = 0\n", - " Feb = 1\n", - " Mar = 2\n", - " Apr = 3\n", - " May = 4\n", - " June = 5\n", - " July = 6\n", - " Aug = 7\n", - " Sep = 8\n", - " Oct = 9\n", - " Nov = 10\n", - " Dec = 11\n", - " \n", - "#Class variable declaration\n", - "c = month()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nJan = %d\"%(c.Jan))\n", - "sys.stdout.write(\"\\nFeb = %d\"%(c.Feb))\n", - "sys.stdout.write(\"\\nJune = %d\"%(c.June))\n", - "sys.stdout.write(\"\\nDec = %d\"%(c.Dec))\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Jan = 0\n", - "Feb = 1\n", - "June = 5\n", - "Dec = 11" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.24, Page number: 434

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Enumerated data type \n", - "\n", - "import sys\n", - "\n", - "#There is no enumerated data type in python and an alternate is to use class\n", - "#Class declaration\n", - "class month:\n", - " Jan = 1\n", - " Feb = 2\n", - " Mar = 3\n", - " Apr = 4\n", - " May = 5\n", - " June = 6\n", - " July = 7\n", - " Aug = 8\n", - " Sep = 9\n", - " Oct = 10\n", - " Nov = 11\n", - " Dec = 12\n", - " \n", - "#Class variable declaration\n", - "c = month()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nJan = %d\"%(c.Jan))\n", - "sys.stdout.write(\"\\nFeb = %d\"%(c.Feb))\n", - "sys.stdout.write(\"\\nJune = %d\"%(c.June))\n", - "sys.stdout.write(\"\\nDec = %d\"%(c.Dec))\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Jan = 1\n", - "Feb = 2\n", - "June = 6\n", - "Dec = 12" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.25, Page number: 434

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display name of month using enumerated data type\n", - "\n", - "import sys\n", - "\n", - "#There is no enumerated data type in python and an alternate is to use class\n", - "#Class declaration\n", - "class month:\n", - " Jan = 1\n", - " Feb = 2\n", - " Mar = 3\n", - " Apr = 4\n", - " May = 5\n", - " June = 6\n", - " July = 7\n", - " Aug = 8\n", - " Sep = 9\n", - " Oct = 10\n", - " Nov = 11\n", - " Dec = 12\n", - " \n", - "#Class variable declaration\n", - "c = month()\n", - "\n", - "#Result\n", - "for f in range(c.Jan,c.Dec+1):\n", - " #There is no switch case statement in python\n", - " if f == c.Jan:\n", - " sys.stdout.write(\"\\nJanuary\")\n", - " else:\n", - " if f == c.Feb:\n", - " sys.stdout.write(\"\\nFebruary\")\n", - " else:\n", - " if f == c.Mar:\n", - " sys.stdout.write(\"\\nMarch\")\n", - " else:\n", - " if f == c.Apr:\n", - " sys.stdout.write(\"\\nApril\")\n", - " else:\n", - " if f == c.May:\n", - " sys.stdout.write(\"\\nMay\")\n", - " else:\n", - " if f == c.June:\n", - " sys.stdout.write(\"\\nJune\")\n", - " else:\n", - " if f == c.July:\n", - " sys.stdout.write(\"\\nJuly\")\n", - " else:\n", - " if f == c.Aug:\n", - " sys.stdout.write(\"\\nAugust\")\n", - " else:\n", - " if f == c.Sep:\n", - " sys.stdout.write(\"\\nSeptember\")\n", - " else:\n", - " if f == c.Oct:\n", - " sys.stdout.write(\"\\nOctober\")\n", - " else:\n", - " if f == c.Nov:\n", - " sys.stdout.write(\"\\nNovember\")\n", - " else:\n", - " sys.stdout.write(\"\\nDecember\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "January\n", - "February\n", - "March\n", - "April\n", - "May\n", - "June\n", - "July\n", - "August\n", - "September\n", - "October\n", - "November\n", - "December" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.26, Page number: 436

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Enumerated data type\n", - "\n", - "import sys\n", - "\n", - "#There is no enumerated data type in python. class is used instead\n", - "class capital:\n", - " Mumbai = 0\n", - " Hyderabad = 1\n", - " Bangalore = 2\n", - "\n", - "class state:\n", - " name = ''\n", - " c = capital()\n", - " \n", - "#Class variable declaration\n", - "s = state()\n", - "c1 = capital()\n", - "\n", - "#Class variable initialization\n", - "s.name = \"Andhra Pradesh\"\n", - "s.c = s.c.Hyderabad\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nState : %s\"%(s.name))\n", - "sys.stdout.write(\"\\nCapital : %d\"%(s.c))\n", - "\n", - "if s.c == c1.Hyderabad:\n", - " sys.stdout.write(\"\\nHyderabad is Capital of %s\"%(s.name))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "State : Andhra Pradesh\n", - "Capital : 1\n", - "Hyderabad is Capital of Andhra Pradesh" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.27, Page number: 437

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Identify the type of entered character using enumerated data type.\n", - "\n", - "import sys\n", - "\n", - "#Class declaration instead of enumerated data type\n", - "class ctype:\n", - " Letter = 0\n", - " Digit = 1\n", - " Other = 2\n", - " \n", - "#Variable Initialization\n", - "ch = raw_input(\"Enter any character\")\n", - "c = ctype()\n", - "f = ch.isalpha()\n", - "\n", - "#Result\n", - "if f != 0:\n", - " sys.stdout.write(\"\\n%c is %d type of symbol\"%(ch,c.Letter))\n", - "else:\n", - " f = ch.isdigit()\n", - " if f != 0:\n", - " sys.stdout.write(\"\\n%c is %d type of symbol\"%(ch,c.Digit))\n", - " else:\n", - " sys.stdout.write(\"\\n%c is %d type of symbol\"%(ch,c.Other))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter any character=\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "= is 2 type of symbol" - ] - } - ], - "prompt_number": 11 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.28, Page number: 438

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Size of union and number of bytes reserved for it\n", - "\n", - "import sys\n", - "\n", - "#There is no union/structure in python. class is used instead\n", - "#Class declaration\n", - "class result:\n", - " marks = 0\n", - " grade = ''\n", - " \n", - "class res:\n", - " name = ''\n", - " age = 0\n", - " perf = result()\n", - " \n", - "#Class variable declaration\n", - "data = res()\n", - "\n", - "#Result\n", - "sys.stdout.write(\"Size of Union : %d\\n\"%(sys.getsizeof(data.perf)))\n", - "sys.stdout.write(\"Size of Structure : %d\\n\"%(sys.getsizeof(data)))\n", - "\n", - "#in python, value tagged method is used for data storage and can represent large numbers" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Size of Union : 36\n", - "Size of Structure : 36\n" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.29, Page number: 440

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Memory size of the computer\n", - "\n", - "import psutil\n", - "\n", - "psutil.phymem_usage()\n", - "\n", - "#Displays current status of the memory\n", - "#different systems will have different memory status" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "pyout", - "prompt_number": 4, - "text": [ - "usage(total=1600512000L, used=1496383488L, free=104128512L, percent=93.5)" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.30, Page number: 440

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the system time at specified cursor position\n", - "\n", - "import sys\n", - "import datetime\n", - "\n", - "#Result\n", - "sys.stdout.write(\"%s\"%(datetime.datetime.now()))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "2013-09-20 11:04:15.649000" - ] - } - ], - "prompt_number": 11 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.31, Page number: 441

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Change the cursor in different sizes\n", - "\n", - "import turtle\n", - "#Ipython supports graphics through turtle module\n", - "\n", - "from Tkinter import *\n", - "import Tkinter\n", - "\n", - "top = Tkinter.Tk()\n", - "\n", - "B1 = Tkinter.Button(top, text =\"circle\", relief=RAISED,\\\n", - " cursor=\"circle\")\n", - "B2 = Tkinter.Button(top, text =\"plus\", relief=RAISED,\\\n", - " cursor=\"plus\")\n", - "B1.pack()\n", - "B2.pack()\n", - "#top.mainloop()" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.32, Page number: 441

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Create a directory using dos interrupt\n", - "\n", - "import os\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "dir1 = raw_input(\"Enter Directory Name : \")\n", - "\n", - "#Result\n", - "if not os.path.exists(dir1):\n", - " os.makedirs(dir1)\n", - " sys.stdout.write(\"Directory %s created\"%(dir1))\n", - "else:\n", - " sys.stdout.write(\"Directory %s not created\"%(dir1))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Directory XYZ created" - ] - } - ], - "prompt_number": 8 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.33, Page number: 442

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the given character on the screen\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "dl = 67\n", - "\n", - "#Result\n", - "sys.stdout.write(\"%c\"%(chr(dl)))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "C" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.34, Page number: 442

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the attributes of a file using DOS interrupt\n", - "\n", - "import sys\n", - "\n", - "import os\n", - "\n", - "print os.stat(\"IO.SYS\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "nt.stat_result(st_mode=33206, st_ino=0L, st_dev=0, st_nlink=0, st_uid=0, st_gid=0, st_size=0L, st_atime=1383454467L, st_mtime=1383454467L, st_ctime=1383454467L)\n" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.35, Page number: 444

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Delete a file using dos interrupt\n", - "\n", - "import os\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "file1 = raw_input(\"Enter a file name : \")\n", - "\n", - "try:\n", - " os.remove(file1)\n", - " sys.stdout.write(\"File successfully deleted\")\n", - "except:\n", - " sys.stdout.write(\"File could not be deleted\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "File successfully deleted" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 13.36, Page number: 445

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Structuret within union\n", - "\n", - "import sys\n", - "\n", - "#there is no union/structure in python. class is used instead\n", - "#Class declaration\n", - "class x:\n", - " f = 0.0\n", - " p = ['' for i in range(0,2)]\n", - " \n", - "class z:\n", - " set1 = x()\n", - " \n", - "#Class variable declaration and initialization\n", - "st = z()\n", - "\n", - "st.set1.f = 5.5\n", - "st.set1.p[0] = 65\n", - "st.set1.p[1] = 66\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\n%g\"%(st.set1.f))\n", - "sys.stdout.write(\"\\n%c\"%(st.set1.p[0]))\n", - "sys.stdout.write(\"\\n%c\"%(st.set1.p[1]))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "5.5\n", - "A\n", - "B" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter14.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter14.ipynb deleted file mode 100755 index 409585bd..00000000 --- a/Programming_in_C_using_ANSI_C/KamthaneChapter14.ipynb +++ /dev/null @@ -1,2311 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Chapter 14: Files

" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.1, Page number: 454

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Write data to text file and read it\n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','a')\n", - "\n", - "#Write data to file if successfully created the file\n", - "if fp == 0:\n", - " sys.stdout.write(\"Cannot open file\")\n", - "else:\n", - " sys.stdout.write(\"Write data & to stop press '.'\")\n", - " c = ''\n", - " while c != '.':\n", - " c = raw_input(\"Write data & to stop press '.'\")\n", - " fp.write(c)\n", - " fp.close()\n", - "\n", - " #Read and display the contents of file\n", - " sys.stdout.write(\"\\nContents read : \")\n", - " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n", - " f = fp.readlines()\n", - " for f1 in f:\n", - " print f1\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Write data & to stop press '.'" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Write data & to stop press '.'ABCDEFGHIJK\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Write data & to stop press '.'.\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Contents read : ABCDEFGHIJK.\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.2, Page number: 455

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display the contents of the file before and after appending.\n", - "\n", - "import sys\n", - "\n", - "#Open file for read data\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n", - "\n", - "#Read and display the contents of file\n", - "sys.stdout.write(\"\\nContents of file before appending :\\n\")\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n", - "f = fp.readlines()\n", - "for f1 in f:\n", - " print f1\n", - "\n", - "#Open file for appending\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','a')\n", - "\n", - "if f == 0:\n", - " sys.stdout.write(\"File can not appended\")\n", - "else:\n", - " c = ''\n", - " #fp.write('\\n')\n", - " while c != '.':\n", - " c = raw_input(\"Enter string to append\")\n", - " fp.write(c)\n", - " \n", - " fp.close()\n", - " \n", - " #Read and display the contents of file\n", - " sys.stdout.write(\"\\nContents of file After appending\\n\")\n", - " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n", - " f = fp.readlines()\n", - " for f1 in f:\n", - " print f1\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Contents of file before appending :\n", - "String is terminated with '\\0'.\n", - "\n", - "Contents of file After appending\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "String is terminated with '\\0'.This character is called as NULL character.\n" - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.3, Page number: 457

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Writing and reading of a file.\n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','w+')\n", - "\n", - "#Write data to file if successfully created the file\n", - "if fp == 0:\n", - " sys.stdout.write(\"Cannot open file\")\n", - "else:\n", - " sys.stdout.write(\"Write data & to stop press '.'\")\n", - " c = ''\n", - " while c != '.':\n", - " c = raw_input(\"Write data & to stop press '.'\")\n", - " fp.write(c)\n", - " fp.close()\n", - "\n", - " #Read and display the contents of file\n", - " sys.stdout.write(\"\\nContents read : \")\n", - " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n", - " f = fp.readlines()\n", - " for f1 in f:\n", - " print f1\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Write data & to stop press '.'\n", - "Contents read : " - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "ABCDEFGHIJK.\n" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.4, Page number: 458

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Open a file in append mode and add new records in it.\n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','a+')\n", - "\n", - "#Write data to file if successfully created the file\n", - "if fp == 0:\n", - " sys.stdout.write(\"Cannot open file\")\n", - "else:\n", - " sys.stdout.write(\"Write data & to stop press '.'\")\n", - " c = ''\n", - " while c != '.':\n", - " c = raw_input(\"Write data & to stop press '.'\")\n", - " fp.write(c)\n", - " fp.close()\n", - "\n", - " #Read and display the contents of file\n", - " sys.stdout.write(\"\\nContents read : \")\n", - " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','a+')\n", - " f = fp.readlines()\n", - " for f1 in f:\n", - " print f1\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Write data & to stop press '.'\n", - "Contents read : " - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "This is append and read mode.\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.5, Page number: 459

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Open a file in read/write mode in it\n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r+')\n", - "\n", - "#Write data to file if successfully created the file\n", - "if fp == 0:\n", - " sys.stdout.write(\"Cannot open file\")\n", - "else:\n", - " #Read and display the contents of file\n", - " sys.stdout.write(\"\\nContents read : \")\n", - " f = fp.readlines()\n", - " for f1 in f:\n", - " print f1\n", - " \n", - " sys.stdout.write(\"Write data & to stop press '.'\")\n", - " c = ''\n", - " while c != '.':\n", - " c = raw_input(\"Write data & to stop press '.'\")\n", - " fp.write(c)\n", - " fp.close()\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Contents read : Help me.\n", - "Write data & to stop press '.'" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.6, Page number: 460

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Open a file for read/write operation in binary mode\n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','wb')\n", - "\n", - "#Write data to file if successfully created the file\n", - "if fp == 0:\n", - " sys.stdout.write(\"Cannot open file\")\n", - "else:\n", - " sys.stdout.write(\"Write data & to stop press '.'\")\n", - " c = ''\n", - " while c != '.':\n", - " c = raw_input(\"Write data & to stop press '.'\")\n", - " fp.write(c)\n", - " fp.close()\n", - "\n", - " #Read and display the contents of file\n", - " sys.stdout.write(\"\\nContents read : \")\n", - " fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','rb')\n", - " f = fp.readlines()\n", - " for f1 in f:\n", - " print f1\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Write data & to stop press '.'\n", - "Contents read : " - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "ABCDEFGHIJK.\n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.7, Page number: 462

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Open a text file and write some text \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','w')\n", - "\n", - "#Read the string\n", - "text = raw_input(\"Enter Text Here : \")\n", - "\n", - "#Write to the file\n", - "#fp.write() is the equivalent function for fprintf() in python\n", - "fp.write(\"%s\"%(text))\n", - "\n", - "#To see the result, open the data.txt file" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 4 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.8, Page number: 463

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Enter data into the text file and read the same. \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','w')\n", - "\n", - "#Read the data\n", - "text = raw_input(\"Name & Age\")\n", - "age = int(raw_input(\"Name & Age\"))\n", - "\n", - "#Write to file\n", - "fp.write(\"%s %d\"%(text,age))\n", - "\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\data.txt','r')\n", - "#Result\n", - "sys.stdout.write(\"Name\\tAge\\n\")\n", - "text = fp.read()\n", - "age = fp.read()\n", - "sys.stdout.write(\"%s\\t%s\\n\"%(text,age))\n", - "fp.close()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Name\tAge\n", - "AMIT 12\t\n" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.9, Page number: 463

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read the contents of the file \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "f = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\list.txt','r')\n", - "\n", - "if f == 0:\n", - " sys.stdout.write(\"Cannot open file\")\n", - "else:\n", - " for c in f:\n", - " sys.stdout.write(\"%s\"%(c))\n", - " #Python gives iterative statements there is no getc() fucntion" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "aman\n", - "akash\n", - "amit\n", - "ajay\n", - "ankit" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.10, Page number: 464

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Write some text into the file \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\words.doc','w')\n", - "\n", - "#Write data to file\n", - "c = ''\n", - "while c != '*':\n", - " c = raw_input(\"Enter Few Words '*' to Exit\")\n", - " fp.write(c)\n", - "\n", - "fp.close()\n", - " #There is no putc() function in python\n", - " #Open the file to see the result" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.11, Page number: 465

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Count\n", - "\n", - "# Total number of statements\n", - "# Total number of included files\n", - "# Total number of blocks and brackets\n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fs = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\PRG2.C','r')\n", - "\n", - "#variable initialization\n", - "i = 0\n", - "c = 0\n", - "sb = 0\n", - "b = 0\n", - "\n", - "if fs == 0:\n", - " sys.stdout.write(\"File opening error\")\n", - "else:\n", - " for line in fs:\n", - " k = 0\n", - " while k < len(line):\n", - " if line[k] == ';':\n", - " c += 1\n", - " else:\n", - " if line[k] == '{':\n", - " sb += 1\n", - " else:\n", - " if line[k] == '(':\n", - " b += 1\n", - " else:\n", - " if line[k] == '#':\n", - " i += 1\n", - " k += 1\n", - " \n", - " #Result\n", - " sys.stdout.write(\"\\nSummary of 'C' Program\\n\")\n", - " sys.stdout.write(\"===========================\")\n", - " sys.stdout.write(\"\\nTotal Statments : %d\"%(c+i))\n", - " sys.stdout.write(\"\\nInclude Statements : %d\"%(i))\n", - " sys.stdout.write(\"\\nTotal Blocks {} : %d\"%(sb))\n", - " sys.stdout.write(\"\\nTotal Brackets () : %d\"%(b))\n", - " sys.stdout.write(\"\\n============================\")\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Summary of 'C' Program\n", - "===========================\n", - "Total Statments : 8\n", - "Include Statements : 2\n", - "Total Blocks {} : 2\n", - "Total Brackets () : 9\n", - "============================" - ] - } - ], - "prompt_number": 8 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.12, Page number: 466

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Write text to a file \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('C:\\Users\\Aathira\\Documents\\IPython Notebooks\\lines.txt','w')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"\")\n", - "else:\n", - " #Write data to file\n", - " c = ''\n", - " while c != '*':\n", - " c = raw_input(\"\")\n", - " fp.write(c)\n", - " fp.close()\n", - " #There is no fputc() function in python\n", - " #Open the file to see the result" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 10 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.13, Page number: 467

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read text from the given file \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "\n", - "file1 = raw_input(\"Enter File Name : \")\n", - "fp = open(file1,'r')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"File not found\\n\")\n", - "else:\n", - " for text in fp:\n", - " print text\n", - " #File pointer itself is iterable in python" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "#include \n" - ] - } - ], - "prompt_number": 11 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.14, Page number: 468

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Write a string into a file \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "\n", - "file1 = raw_input(\"Enter the name of file : \")\n", - "fp = open(file1,'w')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"File can not opened\\n\")\n", - "else:\n", - " text = raw_input(\"Enter Text Here : \")\n", - " fp.write(text)\n", - " \n", - " #Write() function is used to write character or string into the file in python\n", - " # there is no fputc() function in python\n", - "#open the file to see the result" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 13 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.15, Page number: 469

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Write integers in a file \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('num.txt','w')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"File does not exist\\n\")\n", - "else:\n", - " v = ' '\n", - " while v != '0':\n", - " fp.write(v)\n", - " v = raw_input(\"Enter Numbers\")\n", - " \n", - " #open the file to see the result" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.16, Page number: 470

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read integers from the file \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open('num.txt','r')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"File does not exist\\n\")\n", - "else:\n", - " for v in fp:\n", - " print v" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "1 2 3 4 5\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.17, Page number: 471

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Write a block of structure elements to the given file \n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class student:\n", - " name = ''\n", - " age = 0\n", - " \n", - "#Class variable declaration\n", - "stud = [student() for i in range(0,5)]\n", - "\n", - "#Open file\n", - "file1 = raw_input(\"Enter the file name : \")\n", - "fp = open(file1,'w')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"File does not exist\\n\")\n", - "else:\n", - " n = int(raw_input(\"How Many Records : \"))\n", - " for i in range(0,n):\n", - " stud[i].name = raw_input(\"Name : \")\n", - " stud[i].age = int(raw_input(\"Age : \"))\n", - " \n", - " j = 0\n", - " while j < n:\n", - " fp.write(\"%s %d\\n\"%(stud[j].name,stud[j].age))\n", - " j += 1\n", - " \n", - " fp.close()\n", - " \n", - " #open the file to see the result" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.18, Page number: 472

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Write and read the information about the player \n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class record:\n", - " player = ''\n", - " age = 0\n", - " runs = 0\n", - " \n", - "#Class variable declaration\n", - "emp = record()\n", - "\n", - "#Open file\n", - "fp = open('record.dat','w')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"Can not open the file\\n\")\n", - "else:\n", - " emp.player = raw_input(\"Enter Player Name\")\n", - " emp.age = int(raw_input(\"Enter Age\"))\n", - " emp.runs = int(raw_input(\"Enter runs scored\"))\n", - " fp.write(\"%s %d %d\"%(emp.player,emp.age,emp.runs))\n", - " fp.close()\n", - " \n", - " fp = open('record.dat','r')\n", - " if fp == 0:\n", - " sys.stdout.write(\"Error in opening file\")\n", - " else:\n", - " sys.stdout.write(\"\\nRecord Entered is\\n\")\n", - " emp.player,emp.age,emp.runs = fp.read().split(' ')\n", - " sys.stdout.write(\"\\n%s %s %s\"%(emp.player,emp.age,emp.runs))\n", - " fp.close()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Player NameSachin\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Age25\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter runs scored10000\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Record Entered is\n", - "\n", - "Sachin 25 10000" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.19, Page number: 473

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Write a block of structure elements to the given file \n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "next1 = 'Y'\n", - "\n", - "#Class declaration\n", - "class bike:\n", - " name = ''\n", - " avg = 0\n", - " cost = 0.0\n", - " \n", - "#Class variable declaration\n", - "e = bike()\n", - "\n", - "#open file\n", - "fp = open('bk.txt','wb')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"Cannot open file\")\n", - "else:\n", - " while next1 == 'Y':\n", - " e.name = raw_input(\"Model Name\")\n", - " e.avg = int(raw_input(\"Average\"))\n", - " e.cost = float(raw_input(\"Price\"))\n", - " fp.write(\"%s %d %f\\n\"%(e.name,e.avg,e.cost))\n", - " \n", - " next1 = raw_input(\"Add Another (Y/N):\")\n", - " fp.close()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Model NameHONDA\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Average80\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Price45000\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Add Another (Y/N):Y\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Model NameSUZUKI\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Average65\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Price43000\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Add Another (Y/N):Y\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Model NameYAMAHA\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Average55\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Price48000\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Add Another (Y/N):N\n" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.20, Page number: 474

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read the information about the bike \n", - "\n", - "import sys\n", - "\n", - "#Class declaration\n", - "class bike:\n", - " name = ''\n", - " avg = 0\n", - " cost = 0.0\n", - " \n", - "#Class variable declaration\n", - "e = bike()\n", - "\n", - "#open file\n", - "fp = open('bk.txt','rb')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"Cannot open file\")\n", - "else:\n", - " lines = fp.readlines()\n", - " for line in lines:\n", - " e.name,e.avg,e.cost = line.split(' ')\n", - " e.avg = int(e.avg)\n", - " e.cost = float(e.cost)\n", - " sys.stdout.write(\"\\n%s %d %.2f\"%(e.name,e.avg,e.cost))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "HONDA 80 45000.00\n", - "SUZUKI 65 43000.00\n", - "YAMAHA 55 48000.00" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.21, Page number: 476

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read the text after skipping n characters from beginning of the file\n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open(\"text.txt\",\"r\")\n", - "\n", - "sys.stdout.write(\"\\nContents of file\\n\")\n", - "ch = fp.read()\n", - "sys.stdout.write(\"%s\"%(ch))\n", - "\n", - "#Read n\n", - "n = int(raw_input(\"How many characters including spaces would you like to skip?\"))\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nInformation after %d bytes\\n\"%(n))\n", - "\n", - "ch = ch[n:]\n", - "sys.stdout.write(\"%s\"%(ch))\n", - "\n", - "fp.close()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Contents of file\n", - "THE C PROGRAMMING LANGUAGE INVENTED BY DENNIS RITCHIE" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "How many characters including spaces would you like to skip?18\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Information after 18 bytes\n", - "LANGUAGE INVENTED BY DENNIS RITCHIE" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.22, Page number: 477

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read last few characters of the file \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open(\"text.txt\",\"r\")\n", - "\n", - "sys.stdout.write(\"\\nContents of file\\n\")\n", - "ch = fp.read()\n", - "sys.stdout.write(\"%s\"%(ch))\n", - "\n", - "#Read n\n", - "n = int(raw_input(\"How many characters including spaces would you like to skip?\"))\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nInformation after %d bytes\\n\"%(n))\n", - "\n", - "print ch[-n:]\n", - "\n", - "fp.close()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Contents of file\n", - "HELLO WORLD" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "How many characters including spaces would you like to skip?5\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Information after 5 bytes\n", - "WORLD\n" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.23, Page number: 477

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display 'c' program files in current directory. \n", - "\n", - "import sys\n", - "\n", - "#Variable initialization\n", - "l = 0\n", - "c = 0\n", - "\n", - "#Open file\n", - "file1 = raw_input(\"Enter the file name : \")\n", - "fp = open(file1,'r')\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nContents of 'c' program file in capital case\")\n", - "sys.stdout.write(\"\\n============================================\\n\")\n", - "\n", - "ch = fp.readlines()\n", - "\n", - "for line in ch:\n", - " i = 0\n", - " #print line.upper()\n", - " while i < len(line):\n", - " if line[i] =='\\n':\n", - " l += 1\n", - " else:\n", - " c += 1\n", - " sys.stdout.write(\"%c\"%(line[i].upper()))\n", - " i += 1\n", - "\n", - "sys.stdout.write(\"\\nTotal Characters : %d\"%(c))\n", - "sys.stdout.write(\"\\nTotal Lines : %d\"%(l))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Contents of 'c' program file in capital case\n", - "============================================\n", - "MAIN()\n", - "{\n", - "PRINTF(\" HELLO WORLD\");\n", - "}\n", - "\n", - "Total Characters : 31\n", - "Total Lines : 4" - ] - } - ], - "prompt_number": 20 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.24, Page number: 479

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Detect the end of file \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open(\"text.txt\",\"r\")\n", - "\n", - "#there is no feof() function in python\n", - "c = fp.tell()\n", - "sys.stdout.write(\"File pointer at the beginning of the file : %d\\n\"%(c))\n", - "\n", - "c = fp.read()\n", - "sys.stdout.write(\"%s\"%(c))\n", - "\n", - "c = fp.tell()\n", - "sys.stdout.write(\"\\nFile pointer at the end of file : %d\"%(c))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "File pointer at the beginning of the file : 0\n", - "TECHNOCRATS LEAD THE WORLD \n", - "File pointer at the end of file : 32" - ] - } - ], - "prompt_number": 26 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.25, Page number: 480

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Detect an error while read/write operation of a file is in use.\n", - "\n", - "import sys\n", - "\n", - "#Variable initialization\n", - "next1 = 'Y'\n", - "\n", - "#open file\n", - "fp = open('marks.dat','r')\n", - "\n", - "if fp == 0:\n", - " sys.stdout.write(\"Can not open file\")\n", - "else:\n", - " while next1 == 'Y':\n", - " name = raw_input(\"Enter Name, Marks, Percentage\")\n", - " marks = int(raw_input(\"Enter Name, Marks, Percentage\"))\n", - " \n", - " p = marks/7\n", - " try:\n", - " fp.write(\"%s %d %f\"%(name,marks,p))\n", - " except:\n", - " sys.stdout.write(\"\\nUnable to write data?\")\n", - " sys.stdout.write(\"\\nFile opening mode is incorrect.\")\n", - " fp.close()\n", - " \n", - " next1 = raw_input(\"Continue Y/N:\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Name, Marks, PercentageKAMAL\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter Name, Marks, Percentage540\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Unable to write data?\n", - "File opening mode is incorrect." - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Continue Y/N:N\n" - ] - } - ], - "prompt_number": 10 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.26, Page number: 481

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Catch the error that is occurred while file operation\n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "f = open(\"io8.c\",\"w\")\n", - "\n", - "if f == 0:\n", - " sys.stdout.write(\"\\nCannot open file\")\n", - "else:\n", - " #Exception handling\n", - " try:\n", - " c = fp.readlines()\n", - " sys.stdout.write(\"%s\"%(c))\n", - " except:\n", - " sys.stdout.write(\"\\nCan't read file.\")\n", - "#There is no ferror() function python." - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "Can't read file." - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.27, Page number: 482

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Detect and print the error message\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "file1 = \"lines.txt\"\n", - "\n", - "#Open file\n", - "fr = open(file1,\"w\")\n", - "\n", - "sys.stdout.write(\"%s : \"%(file1))\n", - "#Exception handling\n", - "try:\n", - " c = fp.readlines()\n", - "except:\n", - " sys.stdout.write(\"Permission Denied\")\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "lines.txt : Permission Denied" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.28, Page number: 482

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Print the current position of the file pointer \n", - "\n", - "import sys\n", - "\n", - "#Open file\n", - "fp = open(\"text.txt\",\"r\")\n", - "\n", - "#Set the pointer\n", - "fp.seek(21)\n", - "\n", - "#Result\n", - "while True:\n", - " c = fp.read(1)\n", - " if not c:\n", - " break\n", - " sys.stdout.write(\"%c\\t%d\\n\"%(c,fp.tell()))\n", - "#There is no endof file in python" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "W\t22\n", - "O\t23\n", - "R\t24\n", - "L\t25\n", - "D\t26\n" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.29, Page number: 483

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Detect beginning of file\n", - "\n", - "import sys\n", - "\n", - "#open file\n", - "fp = open(\"text.txt\",\"r\")\n", - "\n", - "fp.seek(12)\n", - "sys.stdout.write(\"Pointer is at %d\\n\"%(fp.tell()))\n", - "sys.stdout.write(\"Before rewind() : \")\n", - "\n", - "#Result\n", - "while True:\n", - " c = fp.read(1)\n", - " if not c:\n", - " break\n", - " sys.stdout.write(\"%c\"%(c))\n", - " \n", - "sys.stdout.write(\"\\nAfter rewind() : \")\n", - "fp.seek(0)\n", - "#There is no rewind function in python\n", - "\n", - "while True:\n", - " c = fp.read(1)\n", - " if not c:\n", - " break\n", - " sys.stdout.write(\"%c\"%(c))\n", - " \n", - "fp.close()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Pointer is at 12\n", - "Before rewind() : LEAD THE WORLD\n", - "After rewind() : TECHNOCRATS LEAD THE WORLD" - ] - } - ], - "prompt_number": 25 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.30, Page number: 484

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Delete the given file \n", - "\n", - "import sys\n", - "import os\n", - "\n", - "#Read file name\n", - "file1 = raw_input(\"Enter The File Name : \")\n", - "\n", - "#There is no remove or unlink file function in python.\n", - "#A file can be deleted using remove function in the os module.\n", - "\n", - "try:\n", - " os.remove(file1)\n", - " sys.stdout.write(\"\\nFile (%s) has been deleted!\"%(file1))\n", - "except:\n", - " sys.stdout.write(\"\\nFile does not exist\")\n", - "\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "File (TEXT.TXT) has been deleted!" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.31, Page number: 485

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Change the name of the file\n", - "\n", - "import os\n", - "import sys\n", - "\n", - "old = raw_input(\"Old File Name : \")\n", - "\n", - "new = raw_input(\"New File Name : \")\n", - "\n", - "os.rename(old, new)\n", - "\n", - "#Check the directory to see the result\n" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 22 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.32, Page number: 486

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Copy the contents of one file to another file\n", - "\n", - "import sys\n", - "\n", - "fs = open(\"a.txt\",\"r\")\n", - "ft = open(\"b.txt\",\"w\")\n", - "c = 0\n", - "\n", - "if fs == 0:\n", - " sys.stdout.write(\"\\nSource file opening error.\")\n", - "else:\n", - " if ft == 0:\n", - " sys.stdout.write(\"\\nTarget file opening error.\")\n", - " else:\n", - " while True:\n", - " ch = fs.read(1)\n", - " if not ch:\n", - " break\n", - " ft.write(\"%c\"%(ch))\n", - " c += 1\n", - " sys.stdout.write(\"\\n%d Bytes copied from 'a.txt' to 'b.txt'.\"%(c))\n", - " c = 0\n", - " #there is no fcloseall() function in python\n", - " fs.close()\n", - " c += 1\n", - " ft.close()\n", - " c += 1\n", - " sys.stdout.write(\"\\n%d files closed.\"%(c))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "45 Bytes copied from 'a.txt' to 'b.txt'.\n", - "2 files closed." - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.33, Page number: 487

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read the contents of three files and find the largest file\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "y = 0\n", - "k = 0\n", - "t = 0\n", - "name = [\"1.txt\",\"2.txt\",\"3.txt\"]\n", - "f = [0 for i in range(0,3)]\n", - "x = [0 for i in range(0,3)]\n", - "\n", - "#Open all the files\n", - "for l in range(0,3):\n", - " fp = open(name[l],\"r\")\n", - " f[l] = fp\n", - " if fp == 0:\n", - " sys.stdout.write(\"\\n%s file not found.\"%(name[l]))\n", - " break\n", - " \n", - "#Read contents of all files\n", - "for l in range(0,3):\n", - " while True:\n", - " c1 = f[l].read(1)\n", - " if not c1:\n", - " break\n", - " x[l] = y\n", - " y += 1\n", - " y = 0\n", - "\n", - "#close the files\n", - "for l in range(0,3):\n", - " f[l].close()\n", - "\n", - "#Print size of all files\n", - "for l in range(0,2+1):\n", - " sys.stdout.write(\"File : %s Bytes : %d\\n\"%(name[l],x[l]))\n", - " t = t + x[l]\n", - " \n", - "#Find largest\n", - "for l in range(t,1,-1):\n", - " for k in range(0,3):\n", - " if l == x[k]:\n", - " sys.stdout.write(\"\\n%s are the largest file.\"%(name[k]))\n", - " break\n", - " if l == x[k]:\n", - " break" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "File : 1.txt Bytes : 16\n", - "File : 2.txt Bytes : 20\n", - "File : 3.txt Bytes : 25\n", - "\n", - "3.txt are the largest file." - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.34, Page number: 488

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Copy 100 characters from a file to an array\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "SIZE = 100\n", - "s = 0\n", - "x = 0\n", - "ch = ['0' for i in range(0,100)]\n", - "\n", - "#Open the files\n", - "f = open(\"poem.txt\",\"r\")\n", - "f2 = open(\"alpha.txt\",\"w\")\n", - "\n", - "if f ==0 or f2 == 0:\n", - " sys.stdout.write(\"?\")\n", - "else:\n", - " while True:\n", - " c = f.read(1)\n", - " x += 1\n", - " if not c:\n", - " break\n", - " else:\n", - " if x == 99:\n", - " break\n", - " else:\n", - " ch[s] = c\n", - " s += 1\n", - "\n", - "for s in range(0,100):\n", - " f2.write(\"%c\"%(ch[s]))\n", - "\n", - "sys.stdout.write(\"Process Completed : Error 0\")\n", - "f.close()\n", - "f2.close()\n", - "\n", - "#There is no perror() function in python" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Process Completed : Error 0" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.35, Page number: 491

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Low level disk I/O operations.\n", - "\n", - "import sys\n", - "\n", - "\n", - "#Variable Initialization\n", - "file1 = raw_input(\"Enter a file name : \")\n", - "\n", - "#Open file\n", - "s = open(file1,\"w\")\n", - "\n", - "#Result\n", - "if s == -1:\n", - " sys.stdout.write(\"File does not exits\")\n", - "else:\n", - " buff = raw_input(\"Enter text below:\")\n", - " s.write(\"%s\"%(buff))\n", - " s.close()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a file name : TEXT\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter text below:PROGRAMMING IN C\n" - ] - } - ], - "prompt_number": 11 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.36, Page number: 492

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read text from a specified file \n", - "\n", - "import sys\n", - "\n", - "#Variable initialization\n", - "file1 = raw_input(\"Enter a file name \")\n", - "\n", - "#open file\n", - "s = open(file1,\"r\")\n", - "\n", - "#Result\n", - "if s == -1:\n", - " sys.stdout.write(\"File does not exists\")\n", - "else:\n", - " while True:\n", - " ch = s.read(1)\n", - " if not ch:\n", - " break\n", - " sys.stdout.write(\"%c\"%(ch))\n", - " \n", - "s.close()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter a file name TEXT\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "PROGRAMMING IN C" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.37, Page number: 493

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Set a buffer size \n", - "\n", - "import sys\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nThis book teaches C\")" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "This book teaches C" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.38, Page number: 494

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display number of arguments and their names\n", - "\n", - "import sys\n", - "\n", - "#Result\n", - "sys.stdout.write(\"\\nTotal number of arguments are %d\\n\"%(len(sys.argv)))\n", - "\n", - "print str(sys.argv)\n", - "\n", - "#Command line arguments can be given in python by the command\n", - "\n", - "# python pgmname.py arg1 arg2 arg3\n", - "\n", - "#This is not possible in ipython notebook" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 8 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.39, Page number: 495

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read any file from command prompt\n", - "\n", - "import sys\n", - "\n", - "#open file\n", - "fp = open(sys.argv[1],\"r\")\n", - "\n", - "#Result\n", - "if fp == 0:\n", - " sys.stdout.write(\"Can not open file\")\n", - "else:\n", - " while True:\n", - " ch = fp.read(1)\n", - " if not ch:\n", - " break\n", - " sys.stdout.write(\"%c\"%(ch))\n", - " \n", - "fp.close()\n", - "\n", - "#This program can be run in python as\n", - "\n", - "# python pgmname.py filename" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.40, Page number: 495

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Command line argument to perform the task of DEL command\n", - "\n", - "import sys\n", - "\n", - "#Check number of arguments\n", - "if len(sys.argv) < 2:\n", - " sys.stdout.write(\"Insufficient Arguments\")\n", - "else:\n", - " fp = open(sys.argv[1],\"r\")\n", - " if fp == 0:\n", - " sys.stdout.write(\"File Not Found\")\n", - " fp.close()\n", - " os.remove(sys.argv[1])\n", - " sys.stdout.write(\"File has been deleted\")\n", - " \n", - "#This program can be deleted using\n", - "# python pgmname.py filename\n" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.41, Page number: 496

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Command line argument to perform the task of REN command\n", - "\n", - "import sys\n", - "\n", - "#Check number of arguments\n", - "if len(sys.srgv) < 3:\n", - " sys.stdout.write(\"Insufficient Arguments\")\n", - "else:\n", - " fp = open(sys.argv[1],\"r\")\n", - " if fp == 0:\n", - " sys.stdout.write(\"File Not Found\")\n", - " else:\n", - " sp = open(sys.argv[2],\"r\")\n", - " if sp == 0:\n", - " fp.close()\n", - " sp.close()\n", - " #Rename file\n", - " os.rename(sys.argv[1],sys.argv[2])\n", - " else:\n", - " sys.stdout.write(\"Duplicate file name or file is in use\")\n", - " \n", - "#This program can be executed as\n", - "\n", - "# python pgmname.py oldfilename newfilename\n" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.42, Page number: 497

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Environment variable and display the various settings.\n", - "\n", - "import sys\n", - "import os\n", - "\n", - "#Result\n", - "print os.environ\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "{'TMP': 'C:\\\\Users\\\\Aathira\\\\AppData\\\\Local\\\\Temp', 'COMPUTERNAME': 'AATHIRA-PC', 'GUROBI_HOME': 'B:\\\\gurobi510\\\\win32', 'USERDOMAIN': 'Aathira-PC', 'PSMODULEPATH': 'C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\Modules\\\\', 'COMMONPROGRAMFILES': 'C:\\\\Program Files (x86)\\\\Common Files', 'PROCESSOR_IDENTIFIER': 'Intel64 Family 6 Model 15 Stepping 13, GenuineIntel', 'PROGRAMFILES': 'C:\\\\Program Files (x86)', 'PROCESSOR_REVISION': '0f0d', 'SYSTEMROOT': 'C:\\\\Windows', 'PATH': 'C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core;B:\\\\gurobi510\\\\win32\\\\bin;C:\\\\Windows\\\\system32;C:\\\\Windows;C:\\\\Windows\\\\System32\\\\Wbem;C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\;C:\\\\Program Files (x86)\\\\Common Files\\\\Adobe\\\\AGL;C:\\\\Program Files\\\\MATLAB\\\\R2009a\\\\bin;C:\\\\Program Files\\\\MATLAB\\\\R2009a\\\\bin\\\\win64;c:\\\\python27\\\\scripts;C:\\\\Program Files (x86)\\\\MiKTeX 2.9\\\\miktex\\\\bin\\\\;C:\\\\Anaconda;C:\\\\Anaconda\\\\Scripts;C:\\\\Program Files (x86)\\\\ffmpeg', 'CLICOLOR': '1', 'PROGRAMFILES(X86)': 'C:\\\\Program Files (x86)', 'COMSPEC': 'C:\\\\Windows\\\\system32\\\\cmd.exe', 'TK_LIBRARY': 'C:\\\\Anaconda\\\\tcl\\\\tk8.5', 'TERM': 'xterm-color', 'TEMP': 'C:\\\\Users\\\\Aathira\\\\AppData\\\\Local\\\\Temp', 'COMMONPROGRAMFILES(X86)': 'C:\\\\Program Files (x86)\\\\Common Files', 'PROCESSOR_ARCHITECTURE': 'x86', 'TIX_LIBRARY': 'C:\\\\Anaconda\\\\tcl\\\\tix8.4.3', 'ALLUSERSPROFILE': 'C:\\\\ProgramData', 'LOCALAPPDATA': 'C:\\\\Users\\\\Aathira\\\\AppData\\\\Local', 'HOMEPATH': '\\\\Users\\\\Aathira', 'PROGRAMW6432': 'C:\\\\Program Files', 'USERNAME': 'Aathira', 'LOGONSERVER': '\\\\\\\\AATHIRA-PC', 'SESSIONNAME': 'Console', 'PROGRAMDATA': 'C:\\\\ProgramData', 'TCL_LIBRARY': 'C:\\\\Anaconda\\\\tcl\\\\tcl8.5', 'GIT_PAGER': 'cat', 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC', 'FP_NO_HOST_CHECK': 'NO', 'WINDIR': 'C:\\\\Windows', 'APPDATA': 'C:\\\\Users\\\\Aathira\\\\AppData\\\\Roaming', 'HOMEDRIVE': 'C:', 'PAGER': 'cat', 'SYSTEMDRIVE': 'C:', 'NUMBER_OF_PROCESSORS': '2', 'PROCESSOR_LEVEL': '6', 'PROCESSOR_ARCHITEW6432': 'AMD64', 'COMMONPROGRAMW6432': 'C:\\\\Program Files\\\\Common Files', 'OS': 'Windows_NT', 'PUBLIC': 'C:\\\\Users\\\\Public', 'USERPROFILE': 'C:\\\\Users\\\\Aathira'}\n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.43, Page number: 498

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Read character from keyboard \n", - "\n", - "import sys\n", - "\n", - "c = '0'\n", - "\n", - "#Result\n", - "while c != ' ':\n", - " c = raw_input(\"\")\n", - " sys.stdout.write(\"%c \"%(c))\n", - " \n", - "#Give space at the end" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "1 2 " - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "3 4 " - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "5 6 " - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "7 8 " - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "9 " - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 14.44, Page number: 499

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display A to Z characters\n", - "\n", - "import sys\n", - "\n", - "#Result\n", - "for a in range(65,91):\n", - " sys.stdout.write(\"%c\\t\"%(chr(a)))" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "A\tB\tC\tD\tE\tF\tG\tH\tI\tJ\tK\tL\tM\tN\tO\tP\tQ\tR\tS\tT\tU\tV\tW\tX\tY\tZ\t" - ] - } - ], - "prompt_number": 11 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Programming_in_C_using_ANSI_C/KamthaneChapter15.ipynb b/Programming_in_C_using_ANSI_C/KamthaneChapter15.ipynb deleted file mode 100755 index 5a99346e..00000000 --- a/Programming_in_C_using_ANSI_C/KamthaneChapter15.ipynb +++ /dev/null @@ -1,1480 +0,0 @@ -<<<<<<< HEAD -{ - "metadata": { - "name": "", - "signature": "sha256:23cf65a359a2231e3abd5faae195b73ed4d5756e6083812ae87c387c1bb53f5a" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Chapter 15: Additional in 'C'

" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 15.1, Page number: 505

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Allocate memory to pointer variable. \n", - "\n", - "import sys\n", - "\n", - "#Variable initialization\n", - "j = 0\n", - "k = int(raw_input(\"How many number : \"))\n", - "p = [0 for i in range(0,k)]\n", - "\n", - "#in python, all variables are allocated using dynamic memory allocation technique and no\n", - "#malloc function and pointer concept is available in python.\n", - "\n", - "#Read the numbers\n", - "while j != k:\n", - " p[j] = int(raw_input(\"Number %d = \"%(j+1)))\n", - " j += 1\n", - " \n", - "j = 0\n", - "\n", - "#Result\n", - "sys.stdout.write(\"The numbers are : \")\n", - "while j != k:\n", - " sys.stdout.write(\"%d\\t\"%(p[j]))\n", - " j += 1\n", - " \n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "How many number : 4\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "4\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Number 1 = 1\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Number 2 = 2\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Number 3 = 3\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Number 4 = 4\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The numbers are : 1\t2\t3\t4\t" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 15.2, Page number: 506

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Memory allocation to pointer variable. \n", - "\n", - "import sys\n", - "\n", - "#Variable initialization\n", - "j = 0\n", - "k = int(raw_input(\"How many Number : \"))\n", - "p = [0 for i in range(0,k)]\n", - "\n", - "#in python, all variables are allocated using dynamic memory allocation technique and no\n", - "#calloc function and pointer concept is available in python.\n", - "\n", - "#Read the numbers\n", - "while j != k:\n", - " p[j] = int(raw_input(\"Number %d = \"%(j+1)))\n", - " j += 1\n", - " \n", - "j = 0\n", - "\n", - "#Result\n", - "sys.stdout.write(\"The numbers are : \")\n", - "while j != k:\n", - " sys.stdout.write(\"%d\\t\"%(p[j]))\n", - " j += 1\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "How many Number : 3\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Number 1 = 45\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Number 2 = 58\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Number 3 = 98\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The numbers are : 45\t58\t98\t" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 15.3, Page number: 507

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Reallocate memory \n", - "\n", - "import sys\n", - "\n", - "#Variable Initialization\n", - "str1 = \"India\"\n", - "\n", - "#in python, value tagged method is used for data storage instead of memory tagging.\n", - "#no realloc function is in python\n", - "\n", - "#Result\n", - "sys.stdout.write(\"str = %s\"%(str1))\n", - "str1 = \"Hindustan\"\n", - "sys.stdout.write(\"\\nNow str = %s\"%(str1))\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "str = India\n", - "Now str = Hindustan" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 15.4, Page number: 508

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display unused memory \n", - "\n", - "import psutil\n", - "\n", - "psutil.phymem_usage()\n", - "\n", - "#There is no coreleft() function in python. phymem_usage function in the module psutil gives the \n", - "#status and usage of physical memory in python." - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 6, - "text": [ - "usage(total=3165270016L, used=987840512L, free=2177429504L, percent=31.2)" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 15.5, Page number: 510

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Linked list\n", - "\n", - "import sys\n", - "\n", - "#Variable Initialziation\n", - "ch = 'y'\n", - "p = 0\n", - "q = []\n", - "\n", - "#Function Definitions\n", - "def gen_rate(m):\n", - " q.append(m)\n", - " \n", - "def show():\n", - " print q\n", - " \n", - "def addatstart(m):\n", - " q.insert(0,m)\n", - " \n", - "def append(m,po):\n", - " q.insert(po,m)\n", - "\n", - "def erase(d):\n", - " q.remove(d)\n", - " \n", - "def count():\n", - " print len(q)\n", - " \n", - "def descending():\n", - " q.sort(reverse=True)\n", - " \n", - "#Get choice\n", - "while ch == 'y':\n", - " n = int(raw_input(\"1. Generate\\n2. Add at starting\\n3. Append\\n4. Delete\\n5. Show\\n6.Count\\n7.Descending\\nEnter your choice: \"));\n", - " #There is no switch statement in python\n", - " if n == 1:\n", - " i = int(raw_input(\"How many node you want : \"))\n", - " for j in range(0,i):\n", - " m = int(raw_input(\"Enter the element : \"))\n", - " gen_rate(m)\n", - " show()\n", - " else:\n", - " if n == 2:\n", - " m = int(raw_input(\"Enter the element : \"))\n", - " addatstart(m)\n", - " show()\n", - " else:\n", - " if n == 3:\n", - " m = int(raw_input(\"Enter the element and position \"))\n", - " po = int(raw_input(\"Enter the element and position\"))\n", - " append(m,po)\n", - " show()\n", - " else:\n", - " if n == 4:\n", - " d = int(raw_input(\"Enter the number for deletion : \"))\n", - " erase(d)\n", - " show()\n", - " else:\n", - " if n == 5:\n", - " show()\n", - " else:\n", - " if n == 6:\n", - " count()\n", - " else:\n", - " if n == 7:\n", - " descending()\n", - " show()\n", - " else:\n", - " sys.stdout.write(\"Enter value between 1 to 7\")\n", - " \n", - " ch = raw_input(\"Do u wnat to continue (y/n)\")\n", - " " - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "1. Generate\n", - "2. Add at starting\n", - "3. Append\n", - "4. Delete\n", - "5. Show\n", - "6.Count\n", - "7.Descending\n", - "Enter your choice: 1\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "How many node you want : 4\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter the element : 1\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter the element : 5\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter the element : 4\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter the element : 7\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "[1, 5, 4, 7]\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Do u wnat to continue (y/n)n\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 15.6, Page number: 518

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Draw circle, line and arc using graphics function\n", - "\n", - "%matplotlib inline\n", - "import pylab\n", - "import matplotlib.pyplot as plt\n", - "\n", - "# matplotlib package is used for graphics\n", - "#Give proportionate sizes to draw\n", - "#draw circle\n", - "circle2=plt.Circle((.5,.5),.2,color='b')\n", - "fig = plt.gcf()\n", - "fig.gca().add_artist(circle2)\n", - "\n", - "\n", - "#draw line\n", - "figure()\n", - "pylab.plot([210,110],[150,150])\n", - "\n", - "#Draw ellipse\n", - "figure()\n", - "from matplotlib.patches import Ellipse\n", - "e = Ellipse(xy=(35, -50), width=10, height=5, linewidth=2.0, color='g')\n", - "fig = plt.gcf()\n", - "fig.gca().add_artist(e)\n", - "e.set_clip_box(plt.axes().bbox)\n", - "e.set_alpha(0.7)\n", - "pylab.xlim([20, 50])\n", - "pylab.ylim([-65, -35])" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 5, - "text": [ - "(-65, -35)" - ] - }, - { - "metadata": {}, - "output_type": "display_data", - "png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD9CAYAAABHnDf0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG6lJREFUeJzt3X9U1GW+B/D3yAzGkL8p1mbmLgoTPyQGWxS1tcZ+QdTB\ne9NtsW6lcYnrXbM6t5Nte2+Ce64Lu+d01uJW2BJ7XfNHNzuL94ZjWU7uqoA/sRX0DgY1g+WKqRAo\nDOP3/vEsSSQjwsx8Z555v875HhjnYebjI7x5fL7P9/lqFEUBERHJZZTaBRARke8x3ImIJMRwJyKS\nEMOdiEhCDHciIgkx3ImIJOQ13J944om3YmNjT91yyy2fDtZm+fLlr5jNZofFYqk/dOjQdN+XSERE\n18pruC9ZsqTSZrNlD/Z8dXV1TlNTU4LD4TCvXbv2yaVLl77u+xKJiOhaeQ33uXPn/mnChAlnB3t+\n69atuY8//vh/AUBmZmbtuXPnxp86dSrW10USEdG10Y7ki1tbWw0mk8nZ99hoNLpcLpcxNjb2VP92\nGo2Gl8ESEQ2Doiia4XzdiE+oDnzjwYJcURQeioKVK1eqXkOwHOwL9gX7wvsxEiMKd4PB0Op0Ok19\nj10ul9FgMLSOqCIiIhqxEYV7bm7u1nXr1j0GADU1NbPGjx9/buCUDBERBZ7XOfdFixZt/OSTT+5o\na2uLMZlMzuLi4pVut1sHAIWFheU5OTnV1dXVOQkJCU3R0dGdlZWVSwJTduiyWq1qlxA02BeXsS8u\nY1/4hmak8zpDehONRgnE+xARyUSj0UBR64QqEREFH4Y7EZGEGO5ERBJiuBMRSYjhTkQkIYY7EZGE\nGO5ERBJiuBMRSYjhTkQkIYY7EZGEGO5ERBJiuBMRSYjhTkQkIYY7EZGEGO5ERBJiuBMRSYjhTkQk\nIYY7EZGEGO5ERBJiuBMRSYjhTkQkIYY7EZGEGO5ERBJiuBMRSYjhTkQkIYY7EZGEGO5ERBJiu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ERE\nJCGGOxGRhBjuREQSYrgTEUmI4U5EJCGGOxGRhP4fViZ/V3kiv9UAAAAASUVORK5CYII=\n", - "text": [ - "" - ] - }, - { - "metadata": {}, - "output_type": "display_data", - "png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAD9CAYAAABdoNd6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGe9JREFUeJzt3X10U3W+7/HfrpRzikXbLmjokEAjoFCatLEBAU8lIxQK\nXAdRl4t4BW8j67JwXc/RVECdqyT3jFCKxQdm6XSWtCMwB9aZw0BnRqgEIaVzEEufbAUdGExtAzFQ\nSj32QQp03z/mxhs7JRCagu3v/Vprr7X720/fL7SfpnvvZCuqqgoAwOAWdasLAAD0P8IeACRA2AOA\nBAh7AJAAYQ8AEiDsAUACIcPeZrMVaTQav8FgqA+MORwOh1ar9ZpMphqTyVSzd+/eeUII8d133/2j\n1WrdbjQa61JSUo7n5eW92N/FAwCuT8iwz8nJKS4tLc0OHlMURbXb7RtrampMNTU1pnnz5u0VQogd\nO3YsFkKIuro6Y1VVVUZhYeHyxsbGMf1XOgDgeoUM+8zMzPL4+PgLPcdVVVV6jiUlJfna29tvv3Ll\nym3t7e23Dx06tOuOO+74r0gWCwC4MUNuZKNNmzY9u2XLlqVms7myoKAgNy4urnXu3Lkfbt26dUlS\nUpKvo6Nj2JtvvvlcXFxca89tFUXhLbsAEKbeXmSHI+wLtCtWrHjX4/Hoa2tr05OSkny5ubkFQgix\nbdu2Jzs7O2N8Pl+Sx+PRv/766y94PB79VYoelNOaNWtueQ30R3/0N/imSAg77BMTE88qiqIqiqIu\nW7bsvYqKiqlCCHH48OEZixYt2nXbbbddGTly5Ln777//PysrK80RqRIA0Cdhh73P50sKzO/atWtR\n4E6diRMnfnHgwIEHhRCivb399iNHjkybNGnS55ErFQBwo0Kes7dardvLyspmNjc3j9DpdE1Op3ON\n2+221NbWpiuKour1ek9hYeFyIYRYvnx54dNPP73ZYDDUd3d3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nnzyyW2B/oSIYL5E+kJDz49XWLlyZX5eXt5qVVXFunXrXux5geHixYtDv/zyS/1dd911qru7W7nV\nF0rC7W/v3r3ZKSkpx86dOzcieL3B0l/w1NsF2oHe369+9avlr776qlNVVfGXv/zlbp1O1ziY+jOZ\nTNVut3umqqpi//79s8xm89GB2F93d7eyZMmSLYGPaglMgyVfrtZfJPMlogUvXrx4e1JS0pno6Ogu\nrVbbVFRUlHP+/PmEWbNm7e/t1qjXXnvt5XHjxv31nnvu+SJwx8CPeerZ3+bNm23jx48/OWbMmK/S\n09Nr0tPTa1asWPHOQO9v6NChFwP/f8HL9Xr9l8G3Xg6G/rq6uqKffPLJrampqfX33ntv1cGDBy0D\nvb/gn7+jR4+ap06d+klaWlrttGnTPq6urjYNxP7Ky8v/SVGU7rS0tNrAz9revXuzB0u+9Nbfnj17\n5kUyXxRV/dGfxgIA9BFPqgIACRD2ACABwh4AJEDYA4AECHsAkABhDwAS+L8uyejsxMIQUAAAAABJ\nRU5ErkJggg==\n", - "text": [ - "" - ] - }, - { - "metadata": {}, - "output_type": "display_data", - "png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD9CAYAAACyYrxEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHftJREFUeJzt3XtQVFe+L/Dv7hc0L3k/7EZBIQKK0MQHd443tlGsmalR\nmUzKTFJJnDKZSumt3MngZByTo5JM0IkJyaSs6LEmzpmYumdizr0TNZk4V3Jil07uGHw08YEGCE3C\n0/AM0DQ03b3uHwQGEC3pRhqW30/VKja72b1/i6XfXuzevbcihAAREclL5e8CiIjozmLQExFJjkFP\nRCQ5Bj0RkeQY9EREkmPQExFJzuug3759+2+zsrI+z87OLlu5cuV/1dbWJgJATU1Nkl6vd5hMJqvJ\nZLJu3rx538SVS0RE46V4ex59V1dXaGhoaBcA7N279+nPP/8866233nqypqYmac2aNR9cunQpc0Ir\nJSIir3g9ox8MeQDo7u4OiY6ObpmYkoiIaEIJ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urqCgUAu90efOLEidWZmZmXvBq/O/0qdPr06WWKoniysrLKhp/u1NraGrly5cqP\np/spXmP176OPPvrBY489digzM/PiwoULP1+3bt2RpqamOH/X6k27ePFipslkupCVlVWWmZl5cc+e\nPc8KMXCKlwzjd7P+yTJ+g81isSwfPCtFlrEb3k6ePGke7N+jjz76jgxjV11dnZyVlVWWlZVVNn/+\n/Mu7du3a5u34KUJMy8NzRER0m3iHKSIiyTHoiYgkx6AnIpIcg56ISHIMeiIiyTHoiYgk9/8B1dqr\nlLRzGX0AAAAASUVORK5CYII=\n", - "text": [ - "" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 15.7, Page number: 519

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Draw boxes and fill with different designs.\n", - "\n", - "%pylab\n", - "#matplotlib package is used for graphics\n", - "from matplotlib.patches import Rectangle\n", - "from matplotlib.collections import PatchCollection\n", - "\n", - "e = Rectangle(xy=(35, -50), width=10, height=5, linewidth=2.0, color='b')\n", - "fig = plt.gcf()\n", - "fig.gca().add_artist(e)\n", - "e.set_clip_box(ax.bbox)\n", - "e.set_alpha(0.7)\n", - "pylab.xlim([20, 50])\n", - "pylab.ylim([-65, -35])\n", - "\n", - "#There are no different automatic fill styles. user should create the styles." - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "display_data", - "png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEACAYAAAC9Gb03AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAErZJREFUeJzt3X9MVff9x/HXuXKbaEoEV3UtN6kILooinNYpf5jsOLlL\nk4WW0YXEpq6J9p/6V0uXOrOIkBRxbizpyDRka5raf+qyxMKW2kBWb2i3uFsQ6w+SggW6C3LNmDZR\nt4Xpzv5ovN8yfqT33At8fe/5SE5y77ncez6ffPTZc4/3Usf3fV8AALNCiz0AAMD8IvQAYByhBwDj\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WltZtpfpKNtZOkl156ST/96U8VCv3fX3dL6zfT/BzHMbN+juOosrJS\nW7Zs0a9+9StJ6a/fgob+1q1bevrpp/Xaa69N+wKV4zhyHGchh5N1t27d0ve//3299tprevDBB/XC\nCy9oeHhY58+f18MPP6yXX355sYcYSCgU0vnz5zU6Oqru7m6dOXNmyuP3+9r99/xisZiZtfv973+v\nVatWyXXdWc9w7+f1m21+VtZPkv74xz+qr69Pp0+f1i9/+Ut98MEHUx7/Kuu3YKH/17/+paefflq7\nd+9WdXW1pC/+S3Tvm7fj4+NatWrVQg0n6+7N79lnn03Nb9WqValFeP755xWPxxd5lJlZvny5vvvd\n76q3t9fU2t1zb349PT1m1u5Pf/qTOjo6VFhYqF27dun999/X7t27zazfTPP7wQ9+YGb9JOnhhx+W\n9MXvE/ve976neDye9votSOh939fevXtVUlKiF198MbX/ySef1JtvvilJevPNN1OBvN/MNr/x8fHU\n7VOnTqm0tHQxhpeRiYmJ1Nvef/zjH+rq6pLrumbWbrb5fflXf9yvaydJhw8fViKR0PDwsN5++219\n+9vf1ltvvWVm/Waa34kTJ0z83ZO++KDAzZs3JUm3b99WZ2enSktL01+/tL9LG8AHH3zgO47jl5WV\n+eXl5X55ebl/+vRp/29/+5u/c+dOf926dX40GvVv3LixEMPJupnm9+677/q7d+/2S0tL/c2bN/tP\nPfWUn0wmF3uoabtw4YLvuq5fVlbml5aW+kePHvV93zezdrPNz8La/bdYLOZXVVX5vm9n/b7szJkz\nqfk9++yzJtZvaGjILysr88vKyvyNGzf6hw8f9n0//fXjC1MAYBz/K0EAMI7QA4BxhB4AjCP0AGAc\noQcA4wg9ABhH6AHAOEIPAMb9B4rEH5DkLOd4AAAAAElFTkSuQmCC\n", - "text": [ - "" - ] - } - ], - "prompt_number": 72 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 15.8, Page number: 520

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display text in different size, font, vertically and horizontally \n", - "\n", - "%matplotlib inline\n", - "\n", - "from pylab import *\n", - "\n", - "#Tkinter package is used for graphics\n", - "# set limits so that it no longer looks on screen to be 45 degrees\n", - "xlim([-5,5])\n", - "\n", - "# Locations to plot text\n", - "l1 = array((1,1))\n", - "l2 = array((5,5))\n", - "\n", - "# Rotate angle\n", - "angle = 90\n", - "trans_angle = gca().transData.transform_angles(array((45,)),\n", - " l2.reshape((1,2)))[0]\n", - "\n", - "# Plot text\n", - "th2 = text(l2[0],l2[1],'Hello(Horizontal Text with fontsize 25)\\n\\n',fontsize=25,\n", - " rotation=0)\n", - "th2 = text(l2[0],l2[1],'Hello(Horizontal Text with fontsize 16)',fontsize=16,\n", - " rotation=0)\n", - "th1 = text(l1[0],l1[1],'Hello(Vertical Text)',fontsize=16,\n", - " rotation=angle)\n", - "show()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "display_data", - "png": "iVBORw0KGgoAAAANSUhEUgAAA0oAAASvCAYAAAA39ApSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XdUFNfj//+ZpRfpoNgAxUZUYpfYAMWKvZfYYmJMSGwx\n3YglxRiVqO8YjcYSeywotogCahKNiga7EUUURRFQqiDL7u8Pz3zf87m/XTqavPN8nHPP0Zk7c++U\nZfe1M3tH1uv1EgAAAADgvzQvugMAAAAA8HdDUAIAAAAAAUEJAAAAAAQEJQAAAAAQEJQAAAAAQEBQ\nAgAAAAABQQkAUCJr164dq9FodF5eXgmlmVdRHj586Org4PC4WrVq9588eWJVWe08L56enrc0Go1u\n3bp1Y150X/4JQkNDQzUajS4gICD6Rffl36Qi9vvzONfT09Od3n333SV169a9YWFhka/RaHQajUaX\nmZlpV1lt/h0o23n06NFOL7ovf3c9e/bcr9FodEeOHOlc0mUISgDwN6d8UNFoNLri6t66dctTqVtZ\nH0pkWTb6AL6i5pXXzJkz52ZmZtp99NFHX1pZWT1Rz4uJifEvzQcG5YPbuHHj1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VdevWjVHarMjXuyExMTH+V69ebTht2rRFxdX18vJKaNOmzR8rV658o6La\nB14kghIA/ANotVpTsSgfsNTu3LlTq02bNn9cuHChSVhY2JSIiIjezZs3Pztw4MAdERERvUvT5sGD\nB7v36tVrn52dXea2bduGLF++fNLFixcbt2/f/td79+5VV9dzdXV9WL9+/b/K0/fz58837dSp09GM\njAz7devWjVm/fv3ozMxMu06dOh09f/58U3XdjIwM++HDh28eOXLkxoMHD3YfMWLEJkn6v7etVa9e\n/d7JkyfbqsuqVasmaDQanY+Pz2VJevZtea9evfatXbt27IwZMxbs3bs3uHv37genTZu26JNPPvlc\n7OPkyZO/NTExKdy8efPwWbNmzd6xY8fAyZMnf6u0p3wr//HHH3+htKncVpaQkOAVGBgYtWrVqgn7\n9+/vOWbMmHWhoaGhhtopD61Wa9qtW7dfVq9e/drUqVMXHzx4sPuECRNWzZ07d+aMGTMWSJIk2djY\n5GzZsmVYXFyc78yZM+dKkiQ9ePCg6ujRo9f37dt396RJk5a7u7snF7U9In9//xhZlvVRUVGByrSo\nqKhAKyurJ+K0atWq3VdfGVMfM0Nt9urVa59S98aNG3WnTJkS9t57732zc+fOAe7u7smDBw/++caN\nG3WN7ZPXX3/9h59//nmwJEnSzJkz5548ebLt8uXLJ0mSJH3yySefT58+fWG3bt1+2bt3b/D777//\n9dq1a8f26tVrn3hlaMOGDaMOHDjQY+nSpe+sWbNm3O3bt2v37dt3t3I+h4eH96tWrdr97t27H1T6\nruzfXr167UtOTnb//vvv3zx06FDXr7766kNLS8s8Y0H59ddf/0F97p44ccJvwIABO01NTbUNGjS4\nJkkV+3o35tdff20vSZL05MkTq7Zt2540Nzd/WrVq1QeTJ0/+Ni8vz1Ks3759+18jIyODKqJt4IXT\n6/UUCoVC+ZuWNWvWjJVlWVdUmT179mdK/fHjx692c3N7kJ6e7qheT1BQ0KGXX375nPL/WbNmhcqy\nrFPXEdfVokWLM/Xr179WWFioUaYlJCR4mpmZPZ02bdpCZVpAQEBUQEBAVHn7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788aNG3WVW6cA\n/Lt88MEH848ePdrJ0KiWwD8RQQkAUG46nU7TrFmzc+PHj/9ReQArgH+PBw8eVPX29o6PjIwMatu2\n7ckX3R+gIhCUAAAAAEDAqHcAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAA\ngICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAA\nAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEA\nAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgB\nAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAo\nAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAg\nKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAg\nICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAA\nICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAA\nACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAA\nAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoA\nAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhK\nAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgI\nSgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAI\nCEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAA\nCAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAA\nAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAA\nAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIA\nAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoIS\nAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKC\nEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAAC\nghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAA\nAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAA\nAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAA\nAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQA\nAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAE\nAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICg\nBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICA\noAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACA\ngKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAA\ngICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAA\nAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEA\nAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgB\nAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAo\nAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAg\nKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAg\nICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAA\nICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAA\nACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAA\nAAAgICgBAAAAgICgBAAAAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoA\nAF1G7TEAACAASURBVAAAICAoAQAAAICAoAQAAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAAA\nAAACghIAAAAACAhKAAAAACAgKAEAAACAgKAEAAAAAAKCEgAAAAAICEoAAAAAICAoAQAAAICAoAQA\nAAAAAoISAAAAAAgISgAAAAAgICgBAAAAgICgBAA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LnXfeOXqvvfZ69sQTT7xZKAEAbFtCCQpW\nX1+/aMmSJX2nT58+fuTIkXf16tXrD3nNTjvttGbkyJF3TZ8+ffySJUv67rvvvk8UMSsAQKVw6x0A\nAEDiihKUkUsvvfSrzz///J5bO/Y///M/e1x66aVf7eqZAAAqkStKUEa6deu2cc6cOYcOGzZsXj62\nYMGCocOGDZu3ceNGX3AAAGxjnf6Fa8KECdf36dNnxQc/+MHfvNGaz33uc9cMGDCgeciQIQsfeeSR\nA9/5EYGIiNWrV+/8rne9a13RcwAAVIJO36N0xhln3HDeeed9+/TTT5+xteOzZ88es3jx4v7Nzc0D\n5s6dO/ycc8757pw5cw7dNqPC9umBBx44+oEHHji6o6OjFBExbdq0iXfccccxm6955ZVX3n3HHXcc\nYxMHAICu0WkoffjDH/7vpUuX1r3R8dtuu23s+PHjp0dEDB8+fO7q1at3XrFiRZ8+ffqseIfnhO3W\nz3/+86P+5V/+5Z83fb7hhhvOyGt69OjRNnjw4Cevueaaz3XtdAAAlanTUHozy5Ytq66trW3Z9Lmm\npqa1tbW1JodSqVTyIBS8DevWrXvXI488cuARRxzxy6JnoWttutIIAHStt/1QeP4/8TeKoo6OjkL/\nufjiiwufoVz+cS6cC+fif8e5AACK87ZCqbq6ellLS0vtps+tra011dXVy97+WFCZJk2aFBs2bNjq\nsd///vdxzDHHbPUYAADvrLcVSmPHjr1txowZp0dEzJkz59Cdd955teeT4G93zTXXxOGHHx7PPPPM\nFj+/++67Y//9949f//rXBU0GAFBZOg2lk08+eebhhx/+0NNPPz2wtra25frrr58wbdq0idOmTZsY\nETFmzJjZ/fr1+13//v0XT5w4cdq///u//0PXjP3Xa2hoKHqEsuFcvK7czsW8efPij3/8Yxx00EEx\nffr0aGtriy984QsxevToGDp0aDz22GPb7M8ut3NRJOcCAOiSF86WSqUO99vDW/PKK6/E+eefH9de\ne2306dMnVq9eHVdeeWWcd955RY9GFyuVStFhMwcAKMTb3swBeGe9+93vjsMPPzx69OgRK1asiAED\nBsSx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r+/+61//+qD77rvvo3/605/+z2GHHfarQw89dM6AAQOaN1+3\neSgBr2tra4s77rgjZsyYEXfeeWesX78+Bg8eHFOmTIlTTz019thjj6JHpIvkL5EmT55c3DAAUOE6\nDaXq6uplLS0ttZs+t7S01G66xW6T2trall133XXlu9/97lfe/e53v3LkkUc+uHDhwiE5lICt2333\n3WP16tXRu3fvmDhxYowfPz4OPvjgoscCAKhone56N3To0AXNzc0Dli5dWtfW1tbjpptuOmns2LG3\nbb7mE5/4xKxf/OIXH2pvb9/hT3/60/+ZO3fu8MGDBz+5bceG7ceRRx4Zt9xySzz//PNxzTXXiCQA\ngDLQ6RWlqqqqDVOnTj135MiRd7W3t+9w5plnXldfX79o2rRpEyMiJk6cOG3QoEFPjRo1qnH//fd/\nrFu3bhvPOuus/xBK8NbdeuutRY8AAEDihbNQsKuvvjrOOeec6NGjx1tav27duvje974X559//jae\njKLZHhwAiiOUoGBDhgyJVatWxYQJE+LTn/507LPPPltd9+STT8bMmTPjhhtuiN69e8fChQu7eFK6\nmlACgOIIJShYe3t7XH/99XHVVVfF4sWLY7fddot99903evfuHRERK1eujN/85jexatWq6NevX1x0\n0UVx1llnRbdunT5iyHZAKAFAcYQSlImOjo5oamqKxsbGmD9/fqxYsSJKpVL06dMnhg4dGh//+Mfj\nox/9aNFj0oWEEgAURygBlCmhBADFce8OAABAIpSgzDz//PNx4YUXxtChQ6Nfv35xyCGHxEUXXRTL\nly8vejQAgIrh1jsoI7/97W/jQx/6UKxevTqOOOKI6NOnTyxfvjweeuih2GWXXeIXv/hFDBgwoOgx\n6SJuvQOA4gglKCN///d/H48//njcc889UVdX99rPn3322RgxYkTsu+++8V//9V/FDUiXEkoA1SpM\nrQAADkdJREFUUByhBGVk5513ju9+97tx8skn/8WxmTNnxjnnnBOrV68uYDKKIJQAoDieUYIy0tbW\nFjvttNNWj+24447R1tbWxRMBAFQmV5SgjBx22GHRq1evuPPOO7d4oezGjRvjmGOOidWrV8dDDz1U\n4IR0JVeUAKA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r7vuujPH\njBkze2vHNg8lAP5S/hJp8uTJxQ0DABWu01AqlUpv+X65Bx544Ojrr79+wi9/+csj3v5YAAAAxek0\nlKqrq5e1tLTUbvrc0tJSW1NT05rXPfbYY/ufddZZ/9HY2Dhql112eWlbDAoAANBVOt31bujQoQua\nm5sHLF26tK6tra3HTTfddNLYsWNv23zNc88994FPfvKTt9x4442n9u/ff/G2HRcAAGDb6/SKUlVV\n1YapU6eeO3LkyLva29t3OPPMM6+rr69fNG3atIkRERMnTpx26aWXfvWll17a5ZxzzvluRET37t3X\nz5s3b1hXDA8AALAtdLo9+Dv2h9geHOCvZntwACjOm75wFgAAoNIIJQAAgEQoAQAAJEIJAAAgEUoA\nAACJUAIAAEiEEgAAQCKUAAAAEqEEAACQCCUAAIBEKAEAACRCCQAAIBFKAAAAiVACAABIhBIAAEAi\nlAAAABKhBAAAkAglAACARCgBAAAkQgkAACARSgAAAIlQAgAASIQSAABAIpQAAAASoQQAAJAIJQAA\ngEQoAQAAJEIJAAAgEUoAAACJUAIAAEiEEgAAQCKUAAAAEqEEAACQCCUAAICkYkKpqamp6BHKhnPx\nOufidc7F65wLAOBNQ6mxsXHUoEGDnhowYEDzlClTJm1tzec+97lrBgwY0DxkyJCFjzzyyIHv/Jhv\nn7/4vM65eJ1z8Trn4nXOBQDQaSi1t7fvcO65505tbGwc9eSTTw6eOXPmyYsWLarffM3s2bPHLF68\nuH9zc/OA73//+2efc8453922IwMAAGxbnYbSvHnzhvXv339xXV3d0u7du68fN27cj2fNmvWJzdfc\ndtttY8ePHz89ImL48OFzV69evfOKFSv6bMuhAQAAtqWqzg4uW7asura2tmXT55qamta5c+cOf7M1\nra2tNX369Fmx+bpSqfROzfw3mzx5ctEjlA3n4nXOxeuci9c5FwBQ2ToNpVKp1PFWfpOOjo4tKij/\ne/k4AABAOev01rvq6uplLS0ttZs+t7S01NbU1LR2tqa1tbWmurp62Ts/KgAAQNfoNJSGDh26oLm5\necDSpUvr2traetx0000njR079rbN14wdO/a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+PnPf37UrrvuurLo\nebrShg0bqgYOHPj0fffd99E999zz+WHDhs2bOXPmyfX19YuKnq0IHR0dpfHjx0/v3bv3i9/85jc/\nX/Q85eDnP//5Uf/6r//6j3a9A4DKVFHPKG3OrVcR55133rfXrl2744gRI+458MADH/mHf/iH/6+9\nO7RhIIYBKJp5wowPlXWDkM51E4R0g7Cg4GOdp7SKdLQBeW8CI0tfBj5Xz/Qvvz/Ccs6fUsp710hK\nKaUxxlFrffXeHxFxRcTVWnuunms1ewIA9rXtRQkAAODOthclAACAO0IJAABgIpQAAAAmQgkAAGAi\nlAAAACZCCQAAYPIF5fe6JjownXYAAAAASUVORK5CYII=\n", - "text": [ - "" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

Example 15.9, Page number: 521

" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "#Display status of mouse button pressed \n", - "\n", - "from Tkinter import *\n", - "from tkFileDialog import askopenfilename\n", - "import Image, ImageTk\n", - "\n", - "if __name__ == \"__main__\":\n", - " root = Tk()\n", - "\n", - " #setting up a tkinter canvas with scrollbars\n", - " frame = Frame(root, bd=2, relief=SUNKEN)\n", - " frame.grid_rowconfigure(0, weight=1)\n", - " frame.grid_columnconfigure(0, weight=1)\n", - " xscroll = Scrollbar(frame, orient=HORIZONTAL)\n", - " xscroll.grid(row=1, column=0, sticky=E+W)\n", - " yscroll = Scrollbar(frame)\n", - " yscroll.grid(row=0, column=1, sticky=N+S)\n", - " canvas = Canvas(frame, bd=0, xscrollcommand=xscroll.set, yscrollcommand=yscroll.set)\n", - " canvas.grid(row=0, column=0, sticky=N+S+E+W)\n", - " xscroll.config(command=canvas.xview)\n", - " yscroll.config(command=canvas.yview)\n", - " frame.pack(fill=BOTH,expand=1)\n", - "\n", - " \n", - "\n", - " #function to be called when mouse is clicked\n", - " def printcoords(event):\n", - " #outputting x and y coords to console\n", - " print \"Mouse Button pressed\"\n", - " print (event.x,event.y)\n", - " #mouseclick event\n", - " canvas.bind(\"