Index
- Introduction
- Arithmetic operators and Python Numbers
- Arithmetic operators and Python Strings
- Arithmetic operators and Python Lists
- Arithmetic operators and Python Tuples
- Arithmetic operators and Python Dictionaries
Introduction
Operator | Name | Example |
---|
+ | Addition | x + y |
- | Subtraction | x - y |
* | Multiplication | x * y |
/ | Division | x / y |
% | Modulus | x % y |
** | Exponentiation | x ** y |
// | Floor division | x // y |
scrivi precedenze operatori
oss: when doing a operation between a integer ad a floating point the end result will be always a floating point
2 Strings:
Strings and a number:
- A sting is an unmutable datatype, this means that can’t be modified
- For this reason every time that we do a arithmetic operation on a string we are not modifying it but we are generating a new one
Arithmetic operators and Python Lists
Arithmetic operators and Python Sets