From 83c1bfceb1b681b4bb7253b47491be2d8b2014a1 Mon Sep 17 00:00:00 2001 From: debashisdeb Date: Fri, 20 Jun 2014 15:42:42 +0530 Subject: removing problem statements --- Programming_in_C/Chapter_06.ipynb | 53 --------------------------------------- 1 file changed, 53 deletions(-) (limited to 'Programming_in_C/Chapter_06.ipynb') diff --git a/Programming_in_C/Chapter_06.ipynb b/Programming_in_C/Chapter_06.ipynb index a612ce70..ef1fef64 100644 --- a/Programming_in_C/Chapter_06.ipynb +++ b/Programming_in_C/Chapter_06.ipynb @@ -27,20 +27,15 @@ "cell_type": "code", "collapsed": false, "input": [ - "#6.1.py\n", - "#Calculating the Absolute Value of an Integer\n", "\n", - "#Variable Declaration/User input\n", "number=12 #number=int(raw_input(\"Type in your number: \"))\n", "\n", - "#Calculation\n", "try:\n", " if( number < 0 ):\n", " number=-number #change sign,if number is negative\n", "except: \n", " print \"not a number\" #Invalid input/value error\n", " \n", - "#Result\n", "print (\"The absolute Value is {0}\".format(number))" ], "language": "python", @@ -68,20 +63,14 @@ "cell_type": "code", "collapsed": false, "input": [ - "#6.2.py\n", - "#Calculating average & counting the number\n", - "#of failures from a set of grades\n", "\n", - "#Variable Declarations\n", "gradeTotal=0\n", "failureCount=0\n", "i=0\n", "\n", - "#User Input\n", "numberOfGrades=5 #numberOfGrades=int(raw_input(\"How many grades will you be entering? \"))\n", "grade=[72,83,91,89,95]\n", "\n", - "#Calculation\n", "while(i='a' and ch <='z') or (ch>='A' and ch<='Z')):\n", " print(\"It's an alphabetic character.\")\n", "elif(ch>='0'and ch<='9'):\n", @@ -328,13 +292,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "#6.8.py\n", - "#evaluate simple expressions of the form\n", - "#\n", "\n", "\n", "try:\n", - "#Variable declaration/User input\n", " print(\"Type in your expression(with spaces inbetween): \")\n", " value1, operator, value2=\"5 + 2\".split()\n", " #value1, operator, value2=raw_input().split()\n", @@ -343,10 +303,8 @@ " print(\"err.. follow the syntax \") \n", " print(\"with spaces inbetween\\n\")\n", "\n", - "#Parsing\n", "value1,value2=[float(value1),float(value2)]\n", "\n", - "#Calculation/Result\n", "if(operator=='+'):\n", " print(\"answer: {0:.2f}\".format(value1+value2))\n", "elif(operator=='-'):\n", @@ -382,13 +340,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "#6.9.py\n", - "#evaluate simple expressions of the form\n", - "# (Version 2)\n", "\n", "\n", "try:\n", - "#Variable declaration/User input\n", " print(\"Type in your expression(with spaces inbetween): \")\n", " value1, operator, value2=\"3 * 5\".split()\n", " #value1, operator, value2=raw_input().split()\n", @@ -398,10 +352,8 @@ " print(\"err.. follow the syntax \") \n", " print(\"with spaces inbetween\\n\")\n", "\n", - "#parsing\n", "value1,value2=[float(value1), float(value2)]\n", "\n", - "#Calculation/Result\n", "if(operator=='+'):\n", " print(\"Answer= {0:.2f}\".format(value1+value2))\n", "elif(operator=='-'):\n", @@ -442,13 +394,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "#6.10.py\n", - "#Generating a Table of Prime Numbers\n", "\n", - "#Variable declarations\n", "p=2\n", "\n", - "#Calculations\n", "while(p<=50): #Outer loop\n", " isPrime=1 #Variable declaration\n", " d=2 \n", @@ -458,7 +406,6 @@ " d=d+1 #End of inner loop\n", " \n", " if( isPrime!=0):\n", - "#Print Result\n", " print \" \",p \n", " p=p+1 #End of outer loop" ], -- cgit