Chapter 1: Physical Quantities

Example 1.1 , Page no:3

In [1]:
import math
from __future__ import division

#initialisation of variables
print"2*10^1";
print"3.043*10^3";
print"8.7*10^6";
print"2.2*10^-1";
print"3.5*10^-1";
2*10^1
3.043*10^3
8.7*10^6
2.2*10^-1
3.5*10^-1

Example 1.2 , Page no:4

In [2]:
import math
from __future__ import division

#initialisation of variables
a=6*10**2+5*10**4;
b=2*10**-2+3*10**-3;
c=7+2*10**-2;
d=6*10**4-4*10**2;
e=3*10**-2-5*10-3;
f=7*10**-5-2*10**-4;
g=6.23*10**-3-6.28*10**-3;

#RESULTS
print '%.2E'%a;
print '%.2E'%b;
print c;
print '%.2E'%d;
print '%.2E'%e;
print '%.2E'%f;
print '%.2E'%g;
5.06E+04
2.30E-02
7.02
5.96E+04
-5.30E+01
-1.30E-04
-5.00E-05

Example 1.3 , Page no:4

In [3]:
import math
from __future__ import division

#initialisation of variables
a=10**5*10**-2;
b=10**4/10**-3;
c=10**3/10**6;
d=10**5*10**-7/10**2;

#RESULTS
print '%.2E'%a;
print '%.2E'%b;
print '%.2E'%c;
print '%.2E'%d;
1.00E+03
1.00E+07
1.00E-03
1.00E-04

Example 1.4 , Page no:4

In [4]:
import math
from __future__ import division

#initialisation of variables
a=(460*0.00003*100000)/(9000*0.0062);

#RESULTS
print round(a);
25.0

Example 1.5 , Page no:4

In [5]:
import math
from __future__ import division

#initialisation of variables
a=10**2*10**4;
b=10**-15;
c=10**12;
d=(3*10**3)**3;
e=((4*10**-5)**3);
f=((2*10**-2)**-4);

#RESULTS
print '%.2E'%a;
print '%.2E'%b;
print '%.2E'%c;
print '%.2E'%d;
print '%.2E'%e;
print '%.2E'%f;
1.00E+06
1.00E-15
1.00E+12
2.70E+10
6.40E-14
6.25E+06

Example 1.6 , Page no:4

In [6]:
import math
from __future__ import division

#initialisation of variables
a=(math.sqrt(10**6));
b=(math.sqrt(5*10**4));
c=(math.sqrt(3*10**5));
d=(math.sqrt(0.000025));

#RESULTS
print '%.2E'%a;
print '%.2E'%b;
print '%.2E'%c;
print '%.2E'%d;
1.00E+03
2.24E+02
5.48E+02
5.00E-03

Example 1.7 , Page no:4

In [7]:
import math
from __future__ import division

#initialisation of variables
a=(10**3);
b=(10**(8/3));
c=((3.8*10**19)**(1/3));
d=((2.7*10**-5)**(1/3));

#RESULTS
print '%.2E'%a;
print '%.2E'%b;
print '%.2E'%c;
print '%.2E'%d;
1.00E+03
4.64E+02
3.36E+06
3.00E-02

Example 1.8 , Page no:5

In [8]:
import math
from __future__ import division

#initialisation of variables
a=(1440*0.621); 

#RESULTS
print"Distance in miles =",round(a,3);
Distance in miles = 894.24

Example 1.9 , Page no:5

In [9]:
import math
from __future__ import division

#initialisation of variables
a=(74*2.54);

#RESULTS
print"Height in cm =",round(a);
Height in cm = 188.0

Example 1.10 , Page no:5

In [10]:
import math
from __future__ import division

#initialisation of variables
a=(1*3.28*3.28);

#RESULTS
print"In ft square=",round(a,3);
In ft square= 10.758

Example 1.11 , Page no:5

In [11]:
import math
from __future__ import division

#initialisation of variables
a=((60*5280)/3600);

print"Velocity in ft/sec =",round(a);
Velocity in ft/sec = 88.0