Mathematical Operators
In this activity, we look at how to use some basic mathematical operators in Python. Many of these operators work in a similar way to how you would expect them to work in a mathematical equation.
Mathematical operators allow Python to perform calculations, making them one of the most important tools for solving numerical problems in code.
Common Operators
Python includes operators for common calculations such as addition, subtraction, multiplication, division, powers, and other mathematical operations. These operators can be used directly with numbers or with variables that store numerical values.
Operators and Variables
Once a number has been stored in a variable, the variable name can be used inside a mathematical expression. This makes it possible to write calculations that are easier to update and reuse.
Exercise: Mathematical Operators
In this exercise, you will have a chance to write and test your own code. Please use Anaconda and Jupyter Notebook to complete the exercise.