# Hello，Python！一起学习Python的数值类型（七）

Python的数值是属于不可改变类型，也就是说，如果我们要修改数字类型变量的值，那么其底层实现的过程是，先将新值存放到内存中，然后修改变量让其指向新的内存地址，换句话说，Python 中修改数值类型变量的值，其实只是修改变量名所表示的内存空间。

1、整型

2、浮点型

1、十进制形式：这种形式就是平常简单的浮点数，例如6.66、666.0、0.666。浮点数必须包含至少一个小数点，否则会被当成整数数值处理。
2、科学计数法形式：例如6.66×可表示为6.66e6或6.66E6。

3、布尔型

4、复数型

1、int(x)：将x转换为一个整数。

2、float(x)：将x转换到一个浮点数。

3、complex(x,y)[y为0时，可直接写为complex(x)]：将x和y转换到一个复数，实数部分为x，虚数部分为y。x和y是数字表达式。

The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea – let’s do more of those!

01-11 120
06-10 287
05-13 104
02-02 1万+
04-15 216
09-26 825
10-13 1万+
04-25 669
02-27 4061
02-23 6879
01-01 833
11-03 1780
12-15 6万+
08-08 5552