Chapter 2 : Unit and Dimensions¶

Example 2.1(1) Page no.10¶

In [1]:
from __future__ import division
print "Example 2.1(1) Page no. 10\n\n"
#convert 8.03 yr to seconds
print "8.03 yr =a\n\n"
yr=365#day
day=24#h
h=60#min
Min=60#second
a=8.03*365*24*60*60
print "8.03 yr is %0.2f seconds \n\n"%(a)

Example 2.1(1) Page no. 10

8.03 yr =a

8.03 yr is 253234080.00 seconds



Example 2.1(2) Page no. 10¶

In [2]:
from __future__ import division
print "Example 2.1(2) Page no.10\n\n"
#convert 150 mile/h to yard/h
print "150 mile/h =x\n\n"
mile=5280.0#ft
ft=(1/3)#yd
x=150*5280*(1.0/3)
print "150 mile/h is %0.2f yd/h\n"%(x)

Example 2.1(2) Page no.10

150 mile/h =x

150 mile/h is 264000.00 yd/h



Example 2.1(3) Page no. 10¶

In [3]:
from __future__ import division
print "Example 2.1(3) Page no. 10\n\n"
#convert 100 m/s**2 to ft/min**2
print "100 m/s**2 =a\n\n"
m =100#cm
cm=(1/30.48)#ft
min=60#sec
a=100*100*(1/30.48)*(60)**2
print "100 m/s**2 is %0.2f ft/min**2\n"%(a)

Example 2.1(3) Page no. 10

100 m/s**2 =a

100 m/s**2 is 1181102.36 ft/min**2



Example 2.1(4) Page no. 10¶

In [4]:
from __future__ import division
print "Example 2.1(4) Page no.10\n\n "
#convert 0.03g/cm**3 to lb/ft**3
print "0.03g/cm**3 =x\n"
g=(1/454)#lb
ft=(30.48)**3#cm**3
x=0.03*(1.0/454)*(30.48)**3
print "0.03g/cm**3 is %0.2f lb/ft**3\n"%(x)

Example 2.1(4) Page no.10

0.03g/cm**3 =x

0.03g/cm**3 is 1.87 lb/ft**3