---
title: Python Numeric Types
localeTitle: Python数字类型
---
Python的[数字类型](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)是：

*   整数（ `int` ）

#### 例子：

```py
print(1) 
 print(100) 
 print(8435367) 
```

*   浮点数（ `float` ）
    *   [构造函数](https://docs.python.org/3/library/functions.html#float)

#### 例子：

```py
print(1.5) 
 print(46.84) 
 print(84357.435) 
```

*   复数
    *   [构造函数](https://docs.python.org/3/library/functions.html#complex)

标准库为数据类型添加

*   [馏分](https://docs.python.org/3/library/fractions.html#module-fractions)
*   [小数点](https://docs.python.org/3/library/decimal.html#module-decimal)

数字对象是从文字或函数和运算符的结果创建的。数字文字的语法已有详细[记载](https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals) 。