Content will go here. Borrow from old tutorial, add in new concepts.
Mathematical Operators
Text goes here.
Mathematical Operators In Python
Operator | Description | Example | Result |
---|---|---|---|
+ | Addition | 5+3 | 8 |
- | Subtraction | 2-8 | -6 |
* | Multiplication | 3*1.5 | 4.5 |
/ | Division | 11/4 | 2.75 |
// | Integer division (quotient) | 11//4 | 2 |
% | Remainder (modulus) | 11%4 | 3 |
** | Exponentiation | 3**2 | 9 |
() | Parentheses | 2*(5+3) | 16 |
Built-In Mathematical Functions
Text goes here.
Built-In Mathematical Functions In Python
Function | Description | Example | Result |
---|---|---|---|
abs(VALUE) | Absolute value (force positive) | abs(-7) | 7 |
max(VALUES) | Largest value in a sequence | max(3, 5, 1, 4) | 5 |
min(VALUES) | Smallest value in a sequence | min(3, 5, 1, 4) | 1 |
pow(BASE, EXPONENT) | Exponentiation (power) | pow(3, 2) | 9 |
round(VALUE [,DECIMALS]) | Round to a fixed number of decimals | round(3.14159, 2) | 3.14 |