One, int type (arbitrary precision integer)
An integral type (int) is a data type that represents an integer. Unlike other computer languages with precision restrictions, Python's integer digits can be any length of bits (limited to computer memory only)
A numeric string is an integral type constant.
The Python interpreter automatically creates an int type object instance.
A numeric string is usually interpreted as a decimal (base 10) number.
Integral type constant
Number system |
Prefix |
Basic Digital |
Example |
Decimal (base 10) |
|
0~9 |
0,1,2,7,999,-12,+12 |
Hexadecimal (base 16) |
0x or 0X |
0~9 and A~f (or a~f) |
0x0,0x1,0x7,0x3e7 |
Octal (base 8) |
0o or 0O |
0~7 |
0o0,0o1,0o2,0o7,0o1747 |
Binary (base 2) |
0b or 0 B |
0,1 |
0b0,0b1,0b10,0b111,0b1100011 |
Type float (limited precision floating point number)
Floating-point types (float) are data types that represent real numbers.
Type of decimal (high precision floating point number)
Know
Iv. Types of fraction (fractions)
Know
V. Type of complex (plural)
Know
1.7 Python Basics-numeric types