CHEMOLYTICA

SECTION

1

Getting Started with Python

From a first calculation to a working Python setup: everything you need before writing real programs.

Illustration: a benzene ring beside lines of code

Section opener. Chemistry on one side, code on the other. This section joins them.

Overview

This section starts with a calculation you already know how to do by hand, the molar mass of a compound, and lets Python do it for you. Once you have seen what a few lines of code can do, we set up a proper working environment, learn to run scripts, and learn to read the error messages that every programmer meets on the first day.

[A second paragraph connecting this section to the rest of the volume.]

In this section you will

  • use Python as a calculator for a real chemical quantity;
  • install Python and Jupyter, and run code in both;
  • keep track of units and significant figures in a program;
  • read a traceback and fix the most common beginner errors.

Key terms in this section

variable · expression · float · integer · interpreter · notebook · script · traceback

END OF SECTION

Section summary · one page, for revision

Problems for Section 1 · [n] problems with answers

Further reading