第二章 python语言基础、ipython及jupyter notebook

matplotlib绘图

第二章 python语言基础、ipython及jupyter notebook

isinstance函数用来检查一个对象是否是特定的类型

第二章 python语言基础、ipython及jupyter notebook

二元运算符和比较运算符

检查两个引用是不是指向同一个对象,用is 和 is not关键字
第二章 python语言基础、ipython及jupyter notebook
is 和 == 时不同的,==只看是不是一样,不看是不是同一个。
第二章 python语言基础、ipython及jupyter notebook

可变和不可变

列表,字典,数组都是可变的;
元组、字符串是不可变的。
第二章 python语言基础、ipython及jupyter notebook
第二章 python语言基础、ipython及jupyter notebook

相互转换

第二章 python语言基础、ipython及jupyter notebook

反斜杠是用来指明特殊符号的。

第二章 python语言基础、ipython及jupyter notebook