iNTERFACEWARE Products Manual > Learning Center > Learning Python > Working With Values and Variables > Arithmetic Operations > Introduction to Arithmetic |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
The following table shows the symbols used to represent the basic arithmetic operations:
Here is a simple example of Python code that contains arithmetic:
A collection of arithmetic operations and their values, such as x * y - z, is sometimes called an arithmetic expression, or expression for short. You can use an arithmetic expression to update the value of a variable. For example:
In the second statement of the example, Python takes the existing value of x, which is 10, and adds 1 to it. The result, 11, is then assigned back to x, overwriting its previous value. The effect is to add 1 to the value of x. |