'missing docstring'错误,即使我添加了它们

问题描述 投票:0回答:1
def cat_latin_word(text):
    """converts the english into cat latin"""
    constant = "bcdfghjklmnprstvwxyzBCDFGHJKLMNPQRSTVWXYZ"
    result = []
    for word in text.split():
        if word[0] in constant:
            word = (str(word)[1:] + str(word)[0] + "eeoow")
            result.append(word)
        elif word == "q":
            word = ("oodbyegeeoow")
            result.append(word)
        else:
            word = (str(word) + "meeoow")
            result.append(word)

    return ' '.join(result)

def cat_latin_from_sentence(text):
    """call the sub cat latin word sub function"""
    return cat_latin_word(text)

def main():
    """Calling for the main function"""
    text = input("Enter the english sentence: ")
    print("cat latin =" + " "+ cat_latin_from_sentence(text))
python
1个回答
-1
投票

我不得不在这里猜测一下你没有张贴实际的Pylint消息,但它是否可能抱怨你特别错过了module docstring?也就是说,文件顶部的docstring描述了整个模块的用途,而不是你所展示的函数级docstrings

© www.soinside.com 2019 - 2024. All rights reserved.