Chapter 1: The Crystal Structure of Solids

Example 1.1, Page 6

In [1]:
#Variable declaration
a=5*10**-8 #a=5A = 5*10^-8cm
n=2

#Calculations
d=n/a**3

#Result
print "the value of d in atoms per cm^3 is %.1e"%d
the value of d in atoms per cm^3 is 1.6e+22

Example 1.3, Page 8

In [2]:
#Variable declaration
a1=5*10**-8# a=5A = 5*10^-8cm
n=2# number of atoms is 2

#Calculations
d=n/(a1*a1*2**0.5)

#Result
print "the value of d in atoms per cm^2 is %.2e"%d
the value of d in atoms per cm^2 is 5.66e+14