摘要: import reimport urllib.request# ------ 获取网页源代码的方法 ---def getHtml(url): page = urllib.request.urlopen(url) html = page.read() return html# ------ getHtml()内输入任意帖子的URL ------html = getHtml("htt... 阅读全文
posted @ 2017-09-11 09:00 大发声 阅读(330) 评论(0) 推荐(0)
摘要: 请给 Person 类增加一个私有属性 __score,表示分数,再增加一个实例方法 get_grade(),能根据 __score 的值分别返回 A-优秀, B-及格, C-不及格三档。 class Person(object): def __init__(self, name, score): 阅读全文
posted @ 2017-09-08 20:13 大发声 阅读(423) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-09-07 19:16 大发声 阅读(78) 评论(0) 推荐(0)