An excerpt of a Jupyter notebook with sample unit-based calculations and conversions in Python using the Pint module.  Note: the ~ command instructs Pint to output units in abbreviated form. The P command adds subscript and superscript formatting.