Calculation Recipes
Recipes for using python as a (powerful) calculator:
- Calculate Interactively: I want to do a physics calculation that would be easy to do incorrectly in a calculator, and/or I might need to repeat it with different givens.
- Use Python Functions: I want to use predefined mathematical (or other) functions, like sine or absolute-value, in my calculation.
- Use Complex Numbers: I want to do a calculation that involves complex numbers.
- Print Formatted Output: I want to control the output of my code so that I can include text, specify precision, and so on.
- Script a Calculation: I want to make a multi-step calculation easier to construct and debug, run multiple times, run again later, and/or have a permanent record of.
- Ask for User Input: I want to be able to run my script (or let someone else run it) with various given values, without having to edit the script each time.