几个函数没写说明
模块里有五个函数,其中两个写了 docstring。运行下面这段程序:
def no_doc(funcs):
return [n for n, d in funcs if not d]
funcs = [('add', '把两个数加起来'), ('sub', None),
('div', '相除;除数为 0 时抛 ValueError'),
('mod', None), ('sqrt', None)]
print(len(no_doc(funcs)))
全部评论