关于Python的基础知识(Basic knowlegde on Python)
基础知识归纳(结合pycharmEDU中的教程、其他网络资源等)
1.常用的数字数据类型(Common used numeric data types)
Name | Notation | Declaration e.g. |
---|---|---|
Integers | int | a = 10 |
Floating | float | b = 3.14 |
Complex | complex | c = 1 + 2j |
String | str | d = 'Python' |
- 备注:
- 在Python 2.7中,int与另一个int运算将导致int结果。 但是,一个浮点运算与int会导致浮点数。
- 在Python 3.x中,int与另一个int运算将导致浮点数。