笨办法学python 习题ex48 示例

时间:2021-06-13 07:52:52
【文件属性】:
文件名称:笨办法学python 习题ex48 示例
文件大小:1KB
文件格式:ZIP
更新时间:2021-06-13 07:52:52
python 笨办法学pythoon 习题48 词汇扫描器代码 。 单元测试代码有微调。 常见错误 1. 'module' object has no attribute 'scan' 在测试文件里改成from ex48.lexicon import Lexicon 2.unbound method scan() must be called with Lexicon instance as first argument (got str instance instead) 类在引用前没有实例化,将测试文件改成 assert_equal(lexicon().scan("north"), [('direction', 'north')]) 3.TypeError: 'tuple' object is not callable 检查元组之间有没有漏加逗号
【文件预览】:
新建文件夹
----lexicon_tests.py(1KB)
----lexicon.py(838B)

网友评论