diff options
author | debashisdeb | 2014-06-21 00:52:25 +0530 |
---|---|---|
committer | debashisdeb | 2014-06-21 00:52:25 +0530 |
commit | 7c756fcc12d21693818e58f6936cab5b7c112868 (patch) | |
tree | 009cb02ec85f4a75ac7b64239751f15361df2bfe /Let_us_C/chapter-1.ipynb | |
parent | 83c1bfceb1b681b4bb7253b47491be2d8b2014a1 (diff) | |
download | Python-Textbook-Companions-7c756fcc12d21693818e58f6936cab5b7c112868.tar.gz Python-Textbook-Companions-7c756fcc12d21693818e58f6936cab5b7c112868.tar.bz2 Python-Textbook-Companions-7c756fcc12d21693818e58f6936cab5b7c112868.zip |
Removed Problem Statements Completely
Diffstat (limited to 'Let_us_C/chapter-1.ipynb')
-rw-r--r-- | Let_us_C/chapter-1.ipynb | 416 |
1 files changed, 205 insertions, 211 deletions
diff --git a/Let_us_C/chapter-1.ipynb b/Let_us_C/chapter-1.ipynb index 5c48f867..215baac9 100644 --- a/Let_us_C/chapter-1.ipynb +++ b/Let_us_C/chapter-1.ipynb @@ -1,212 +1,206 @@ -{
- "metadata": {
- "name": "chapter-1.ipynb"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "<h1>Chapter 1: Getting Started<h1>"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "<h3>First C Program, Page number: 14<h3>\n",
- " "
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "#Variable declaration\n",
- "p = 1000 #principle\n",
- "n = 3 # number of years\n",
- "r = 8.5 # rate of interest\n",
- "\n",
- "#Calculation\n",
- "si = p * n * r / 100 ; #formula for simple interest\n",
- "\n",
- "#Result\n",
- "print ( si )\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "255.0\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "<h3>Simple Interest, Page number: 21<h3>"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "#Input from the user\n",
- "#p,n,r = raw_input(\"Enter values of p, n, r : \").split()\n",
- "p = 100 # principle\n",
- "n = 5 # number of years\n",
- "r = 15.5 # rate of interest\n",
- "\n",
- "#Calculation\n",
- "si = p * n * r / 100 ; #formula for simple interest\n",
- "\n",
- "#Result\n",
- "print ( si )\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "77.5\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "<h3>Just for fun, Page number: 22<h3>"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "#Input from the user\n",
- "#num = raw_input(\"Enter a number : \")\n",
- "num = 11\n",
- "\n",
- "#Result\n",
- "print \"Now I am letting you on a secret...\" \n",
- "print \"You have just entered the number\", num \n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Now I am letting you on a secret...\n",
- "You have just entered the number 11\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "<h3>Example 1.1, Page number: 32<h3>"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "#Calculation\n",
- "i1 = 2 * 3 # operation *\n",
- "i2 = i1 / 4 # operation /\n",
- "i3 = 4 / 4 # operation /\n",
- "i4 = 5 / 8 # operation /\n",
- "i5 = i2 + i3 # operation +\n",
- "i6 = i5 + 8 # operation +\n",
- "i7 = i6 - 2 # operation -\n",
- "i8 = i7 + i4 # operation +\n",
- "i = i8\n",
- "\n",
- "#Result\n",
- "print \"i = \", i"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "i = 8\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "<h3>Example 1.2, Page number: 33<h3>"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "#Calculation\n",
- "kk1 = 3 / 2# operation /\n",
- "kk2 = kk1 * 4 # operation *\n",
- "kk3 = 3 / 8 # operation /\n",
- "kk4 = kk2 + kk3 # operation +\n",
- "kk5 = kk4 + 3 # operation +\n",
- "kk = kk5\n",
- "\n",
- "#Result\n",
- "print \"kk = \", kk\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "kk = 7\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [],
- "language": "python",
- "metadata": {},
- "outputs": []
- }
- ],
- "metadata": {}
- }
- ]
+{ + "metadata": { + "name": "", + "signature": "sha256:67e127b30e1e4aca343f9987e4ae454c0b4254a7be37191ad1b156a6da5403fc" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h1>Chapter 1: Getting Started<h1>" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h3>First C Program, Page number: 14<h3>\n", + " " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "p = 1000 #principle\n", + "n = 3 # number of years\n", + "r = 8.5 # rate of interest\n", + "\n", + "#Calculation\n", + "si = p * n * r / 100 ; #formula for simple interest\n", + "\n", + "#Result\n", + "print ( si )\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "255.0\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h3>Simple Interest, Page number: 21<h3>" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "p = 100 # principle\n", + "n = 5 # number of years\n", + "r = 15.5 # rate of interest\n", + "\n", + "#Calculation\n", + "si = p * n * r / 100 ; #formula for simple interest\n", + "\n", + "#Result\n", + "print ( si )\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "77.5\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h3>Just for fun, Page number: 22<h3>" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "num = 11\n", + "\n", + "#Result\n", + "print \"Now I am letting you on a secret...\" \n", + "print \"You have just entered the number\", num \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Now I am letting you on a secret...\n", + "You have just entered the number 11\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h3>Example 1.1, Page number: 32<h3>" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "i1 = 2 * 3 # operation *\n", + "i2 = i1 / 4 # operation /\n", + "i3 = 4 / 4 # operation /\n", + "i4 = 5 / 8 # operation /\n", + "i5 = i2 + i3 # operation +\n", + "i6 = i5 + 8 # operation +\n", + "i7 = i6 - 2 # operation -\n", + "i8 = i7 + i4 # operation +\n", + "i = i8\n", + "\n", + "#Result\n", + "print \"i = \", i" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "i = 8\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h3>Example 1.2, Page number: 33<h3>" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "kk1 = 3 / 2# operation /\n", + "kk2 = kk1 * 4 # operation *\n", + "kk3 = 3 / 8 # operation /\n", + "kk4 = kk2 + kk3 # operation +\n", + "kk5 = kk4 + 3 # operation +\n", + "kk = kk5\n", + "\n", + "#Result\n", + "print \"kk = \", kk\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "kk = 7\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] }
\ No newline at end of file |