|
1 | 1 | Data types |
2 | 2 | ========== |
3 | 3 |
|
4 | | -Python has several built-in data types, such as :doc:`numbers` (integers, |
5 | | -floating point numbers, complex numbers), :doc:`strings <strings/index>`, |
6 | | -:doc:`lists`, :doc:`tuples`, :doc:`dicts`, :doc:`sets` and :doc:`files`. These |
7 | | -data types can be manipulated using language operators, built-in functions, |
8 | | -library functions or a data type’s own methods. |
| 4 | +Python has several built-in data types, from scalars such as numbers and boolean |
| 5 | +values to more complex structures such as sequences, sets, dictionaries and |
| 6 | +strings. |
| 7 | + |
| 8 | ++-----------------------+-----------------------------------------------+ |
| 9 | +| Data type | Examples | |
| 10 | ++=======================+===============================================+ |
| 11 | +| Numeric types | :class:`int`, :class:`float`, :class:`complex`| |
| 12 | ++-----------------------+-----------------------------------------------+ |
| 13 | +| Boolean type | :class:`bool` | |
| 14 | ++-----------------------+-----------------------------------------------+ |
| 15 | +| Sequences | :class:`list`, :class:`tuple` | |
| 16 | ++-----------------------+-----------------------------------------------+ |
| 17 | +| Sets | :class:`set`, :class:`frozenset` | |
| 18 | ++-----------------------+-----------------------------------------------+ |
| 19 | +| Mappings | :class:`dict` | |
| 20 | ++-----------------------+-----------------------------------------------+ |
| 21 | +| Strings | :class:`str` | |
| 22 | ++-----------------------+-----------------------------------------------+ |
| 23 | +| Files | :func:`open <open>` | |
| 24 | ++-----------------------+-----------------------------------------------+ |
| 25 | + |
| 26 | +These data types can be manipulated using language operators, built-in |
| 27 | +functions, library functions or a data type’s own methods. |
9 | 28 |
|
10 | 29 | You can also define your own classes and create your own class instances. For |
11 | 30 | these class instances, you can define methods as well as manipulate them using |
|
0 commit comments