Professional Documents
Culture Documents
02 - Numbers, Operators - Math
02 - Numbers, Operators - Math
1. An integer is a whole number with no decimal places. E.g 30, 2, -15, 7, -10 etc.
1. A floating-point number, or float for short, is a number with a decimal place. E.g 7.2, -1.2, 10.0 etc.The name
of the floating-point data type is float.
2. Complex numbers
NB: Using the type( ) function we can know the type of the numeric data
Arithmetic operators in Python
Arithmetic operators in python
Operators Meaning uses
+ Addition a + b; 3 + 4 = 7
- Subtraction a - b; 9 - 4 = 5
* Multiplication a * b; 3 * 5 = 15
** Exponential a ** b; 2 ** 2 = 4
/ Division a / b; 8 / 4 = 2.0
// Floor division a // b; 5 // 2 = 2
% Modulus a % b; 5 % 2 = 1
Comments in python in done using the hashtag (#); everything after the hashtag is completely ignored by python
interpreter