In [2]:

```
# To convert area in metre to feet
# Modern Electronic Instrumentation And Measurement Techniques
# By Albert D. Helfrick, William D. Cooper
# First Edition Second Impression, 2009
# Dorling Kindersly Pvt. Ltd. India
# Example 2-1 in Page 29
# Given data
A_m = 5000 # area in metre**2 unit
#Calculation
A_ft = A_m * (1/0.3048)**2 # As 1ft = 0.3048m
print "The area in feet = ",round(A_ft)," sq.ft"
#Result
# The area in feet = 53820 sq.ft
```

In [3]:

```
# To convert flux density to different units
# Modern Electronic Instrumentation And Measurement Techniques
# By Albert D. Helfrick, William D. Cooper
# First Edition Second Impression, 2009
# Dorling Kindersly Pvt. Ltd. India
# Example 2-2 in Page 29
# Given data
B_cm = 20 # flux density in maxwell/sq.cm
#Calculations
B_in = B_cm *2.54**2 # converting to lines/sq.inch
print "The flux density in lines/sq.in =",round(B_in)," lines/(in**2)"
#Result
# The flux density in lines/sq.in = 129 lines/(in**2)
```

In [10]:

```
# To convert velocity to a different unit
# Modern Electronic Instrumentation And Measurement Techniques
# By Albert D. Helfrick, William D. Cooper
# First Edition Second Impression, 2009
# Dorling Kindersly Pvt. Ltd. India
# Example 2-3 in Page 29
# Given data
c_s = 2.997925 * 10**8 # velocity in m/s
#Calculations
c_hr = 2.997925 *10**8* 1/10**3* 3.6*10**3 # velocity in km/hr
print "The velocity of light in km/hr = ","{:.3E}".format(c_hr)," km/hr"
#Result
# The velocity of light in km/hr = 1.079e+009 km/hr
```

In [12]:

```
# To convert density to a different unit
# Modern Electronic Instrumentation And Measurement Techniques
# By Albert D. Helfrick, William D. Cooper
# First Edition Second Impression, 2009
# Dorling Kindersly Pvt. Ltd. India
# Example 2-4 in Page 29
# Given data
Density_ft = 62.5
#Calcualtions
Density_in = 62.5 * (1/12.0)**3
Density_cm = Density_in * 453.6 * (1/2.54)**3
print "(a) The density of water in lb/cubic inch = ",round(Density_in,6)," lb/(in**3).\n"
print "(b) The density of water in g/cubic cm = ",round(Density_cm,6), "g/(cm**3)."
#Result
# (a) The density of water in lb/cubic inch = 0.036169 lb/(in**3).
# (b) The density of water in g/cubic cm = 1.001171 g/(cm**3).
```

In [16]:

```
# To convert speed limit to a different unit
# Modern Electronic Instrumentation And Measurement Techniques
# By Albert D. Helfrick, William D. Cooper
# First Edition Second Impression, 2009
# Dorling Kindersly Pvt. Ltd. India
# Example 2-5 in Page 30
# Given data
speed_km = 60 # speed limit in km/hr
#Calculations
speed_m = 60 *10**3 *10**2 *(1/2.54) *(1/12.0)*(1.0/5280)
speed_ft = 37.3 *5280 *(1/(3.6*10**3))
print "(a) The speed limit in m/hr = ",round(speed_m,1)," mi/hr\n"
print "(b) The speed limit in ft/s = ",round(speed_ft,1)," ft/s"
#Result
# (a) The speed limit in m/hr = 37.3 mi/hr
# (b) The speed limit in ft/s = 54.7 ft/s
#The answer given in textbook is printed incorrectly and does not match with calculated answer
```