I would like to give some feedback about ...
From: https://py.checkio.org/mission/long-repeat/solve/
HTTP_USER_AGENT:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
/home/site/checkio/runners/py32.py:255: DeprecationWarning: cgi.escape is deprecated, use html.escape instead, error = u'TypeError: {0} is wrong data type'.format(cgi.escape(str(type(result)))),TypeError: <class 'builtinfunctionor_method'> is wrong data type
I try to check my code and have this ^^^^ error.
CODE :
def long_repeat(line):
if len(line) > 0:
maxm = 0
cnt = 1
y = line[0]
for i in line:
if cnt == len(line):
return cnt
if i == y and cnt < len(line):
cnt += 1
if cnt > maxm:
maxm = cnt
if i != y:
y = i
cnt = 1
else: return 0
return max
In repl.it and sublime text it works