# Variable
Mwt = 21150 # g / mol
# Solution
m = 2 * 12 + 3 * 1.008 + 1 * 35.45 # g / mer
n = Mwt / m
print "The degree of polymerization is", int(n)
# Variables
n = 10000 # degree of polymerisation
# Solution
m = 8 * 12 + 8 * 1.008 # g / mer
M = n * m
print "Molecular weight of polystyrene chain,", M, "g /mol"
# Variables
d1 = 920 # density, kg / m^3
d2 = 961.97 # density, kg / m^3
dp = 44 # density percentange
# Solution
print "dp = [d2 * (p - d1)] * [100/p * (d2 - d1)]"
p = 937.98
print "Density of sample is", p, "kg / m^3"
# Constant
Na = 6.022 * 10 ** 23 # Avogadros number
# Variables
wt_ethylene = 28 # g
deg = 500
# Solution
n = Na / deg
print "28g of ethylene contains", Na, "molecules"
print "No. of polyethylene formed", "{:.3e}".format(n), "molecules"