即使我添加了“缺少文档字符串”错误

时间:2018-09-11 06:49:41

标签: python

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))

1 个答案:

答案 0 :(得分:-1)

在这里,您不必发布实际的Pylint消息就不得不猜测一下,但是也许是在抱怨您特别想念module docstring吗?也就是说,在文件顶部的docstring描述了整个模块的用途,而不是您所显示的功能级别的docstrings