def checkio(f, g):
def h(args, *kwargs):
try:
f(args, *kwargs)
except:
return g(args, *kwargs), 'ferror'
else:
if f(*args, **kwargs) == None:
return g(*args, **kwargs), 'ferror'
try:
g(*args, **kwargs)
except:
return f(*args, **kwargs), 'g_error'
else:
if g(*args, **kwargs) == None:
return f(*args, **kwargs), 'g_error'
if f(*args, **kwargs) == g(*args, **kwargs):
return f(*args, **kwargs), 'same'
else:
return f(*args, **kwargs), 'different'
return h
the check result is:
ValueError: list.remove(x): x not in list, , 7, h, 17, , 9
find_message("f = lambda lst,rmv: [x for x in lst if x!=rmv]\ng = lambda lst,rmv: lst.remove(rmv) or lst\nc = checkio(f,g)\nresult = c([3,2,3,4,3],2)\n")
and I add the find_message into my code, the result run by pycharm is
ValueError: list.remove(x): x not in list
How could I do?
Created at: 2017/12/25 07:19; Updated at: 2018/01/27 02:13
The question is resolved.