Python program for simple chemical calculations