- Every Variables in Python has a Datatype. In Python you do not need to declare any datatypes, you just write the variable and its value.
- Python automatically decide the types based on our value.
- Datatypes are created when you assign the value of variables.
1. PYTHON NUMERIC:
There are 3 types of Numeric.
- Floating-point Numbers
- Complex Numbers
When you declare numbers, it comes into the Integer datatypes.
2. Floating-point Numbers:
- Floating number is the decimal point numbers.
- Floating point number is up to 15 decimal places.
- E.g. 2 is integer, 2.5 is floating point number.
3. Complex Number:
- It is used when you have complex problem
- Its denoted by x + yj, where x and y are the real numbers and j is the imaginary unit.
2 . Python String:
- String is the collection of characters.
- We can use single quotes( ‘ ) or double quotes( “ ) for declaring string.
- We can use triple quotes ( ‘ ‘ ‘ ) or ( “ “ “ ) for creating Multi-line strings.
3. Python Boolean:
- It is used when we have binary value. It means either 0 or 1 and you can say Yes/No.
- Your answer is in between true and false or 0 and 1.