Quick Thinking

Just now, I was faced with an immense(ly) tedious task: calculate the mass of carbon dioxide that is produced by this reaction. There are fifty data points that I have to calculate it for, which basically is just a lot of basic arithmetic. I was lamenting to myself about how computers should be able to do this with no fuss.

And then I realized that they could. With enthusiasm, I started another xterm and ran the python interactive shell. I copied and pasted my calcium carbonate masses in and assigned it to a variable as a list:
list = [5.85, 5.84, 5.83, 5.81, 5.79, 5.76, 5.72, 5.69, 5.65, 5.62, 5.58, 5.55, 5.51, 5.46, 5.43, 5.39, 5.36, 5.34, 5.31, 5.28, 5.25, 5.21, 5.19, 5.16, 5.12, 5.1, 5.07, 5.04, 5.02, 4.99, 4.97, 4.95, 4.92, 4.9, 4.86, 4.85, 4.82, 4.8, 4.78, 4.76, 4.75, 4.73, 4.71, 4.7, 4.68, 4.66, 4.64, 4.62, 4.61, 4.59, 4.58]
And remembered from a long time ago, the first for loop you learn about:
for i in list:
(5.85-i)*144.1

And it spilled out all of the carbon dioxide masses.

I am so happy when nerd moments like this happen. Hurray for applying theoretical knowledge to something useful. It saved my life.

Tags: ,

One Response to “Quick Thinking”

  1. moyee says:

    hahaha
    (insert “worthy” emoticon, if you know what it is)

Leave a Reply