小编use*_*898的帖子

标识符中的字符无效

我正在处理HP代码大战2012中的信件分发问题.我一直收到一条错误消息,指出标识符中的无效字符.这意味着什么以及如何解决这个问题.这是包含信息的页面.hpcodewars.org/past/cw15/problems/2012ProblemsFinalForPrinting.pdf这里是代码

import  string

def  text_analyzer(text):
'''The text to be parsed and
the number of occurrences of the letters given back
be. Punctuation marks, and I ignore the EOF
simple. The function is thus very limited.

'''
    result =  {}

# Processing
    for  a in  string.ascii_lowercase:
    result [a] =  text.lower (). count (a)

    return  result


def  analysis_result (results):

# I look at the data
    keys =  analysis.keys ()
    values \u200b\u200b=  list(analysis.values \u200b\u200b())
    values.sort (reverse = True )

# I turn to …
Run Code Online (Sandbox Code Playgroud)

python python-3.x

27
推荐指数
3
解决办法
17万
查看次数

标签 统计

python ×1

python-3.x ×1