摘要: 输出: obj = D()print(obj.a)print(obj.b)print(obj.c)print(obj.d) obj.x() obj.y() obj.z() 输出: A.xC.yD.z A.xC.yD.z A.xC.yD.z A.xC.yD.z A.xC.yD.z 阅读全文
posted @ 2017-12-11 20:04 爱学英语的程序媛 阅读(882) 评论(0) 推荐(0) 编辑
摘要: Python的assert是用来检查一个条件,如果它为真,就不做任何事。如果它为假,则会抛出AssertError并且包含错误信息。例如: 1 2 3 4 5 6 py> x = 23 py> assert x > 0, "x is not zero or negative" py> assert 阅读全文
posted @ 2017-12-11 10:51 爱学英语的程序媛 阅读(317) 评论(0) 推荐(0) 编辑
摘要: Your task is to define the following two methods for the intSet class: Define an intersect method that returns a new intSet containing elements that a 阅读全文
posted @ 2017-12-11 10:19 爱学英语的程序媛 阅读(483) 评论(0) 推荐(0) 编辑
摘要: 首先是单下划线开头,这个被常用于模块中,在一个模块中以单下划线开头的变量和函数被默认当作内部函数,如果使用 from a_module import * 导入时,这部分变量和函数不会被导入。不过值得注意的是,如果使用 import a_module 这样导入模块,仍然可以用 a_module._so 阅读全文
posted @ 2017-12-11 10:04 爱学英语的程序媛 阅读(343) 评论(0) 推荐(0) 编辑
摘要: culinary tradition 烹饪传统 crunchy 松脆的 boutique 精品店 migraine 偏头痛 colon 冒号 towel 毛巾 ecstatic 狂喜的 bok choy 青菜 saute (vi.)炒,炒的 edamame 毛豆 scallion 葱 阅读全文
posted @ 2017-12-11 10:02 爱学英语的程序媛 阅读(202) 评论(0) 推荐(0) 编辑