几个函数没写说明

👁️ 3 人浏览 💬 0 人评论 ❤️ 添加收藏

模块里有五个函数,其中两个写了 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)))
提交你的答案
请登录后提交答案。
去登录
代码编辑器
Ctrl + Enter 运行
本次输入:
输出:

                        
👩‍🏫
AI
💬 题目评论

全部评论