Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Compare Functions by DaveDiFranco
def checkio(f,g):
def h(*args,**kwargs):
vf = safe(f, *args, **kwargs)
vg = safe(g, *args, **kwargs)
if vf==vg==None: return None, 'both_error'
if vf==None: return vg, 'f_error'
if vg==None: return vf, 'g_error'
status = ['different','same'][vf==vg]
return vf, status
return h
def safe(f, *args,**kwargs):
try:
return f(*args,**kwargs)
except Exception:
return
April 4, 2016
Comments: