Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
8-liner: Mainly specified each single case. solution in Clear category for Completely Empty by Stensen
def completely_empty(v, r=0):
if not (hasattr(v, '__iter__') and v.__iter__ or \
hasattr(v, '__getitem__') and v.__getitem__): return False
if type(v) is int or v is None: return False
if not v: return True
else:
for i in v: r += 0 if completely_empty(i) else 1
return not r
Nov. 17, 2020