summaryrefslogtreecommitdiff
path: root/Computer_Concepts_and_C_Programming/chapter7.ipynb
blob: 25b2623db7bbedcd33dc588264962619f12ef7b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
 "metadata": {
  "name": "",
  "signature": "sha256:c5adc1aab2163bdfaad00a9f18852cb6fb30a3af1418e251d196ede7718844fa"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "7.OPERATORS AND EXPRESSION"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "7.4.1,page number:145"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "number = 19+9\n",
      "print \"The month of Februry has\",number,\"days\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The month of Februry has 28 days\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "7.8.1,page number:150"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "m = 2\n",
      "n = 12.34\n",
      "result=m*n\n",
      "print m,\"*\",n,\"=\",result\n",
      "print result,\"in scientific notation is\",\"{:.2E}\".format(result)\n",
      "print m,\"*\",n,\"=\",round(result)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "2 * 12.34 = 24.68\n",
        "24.68 in scientific notation is 2.47E+01\n",
        "2 * 12.34 = 25.0\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}