ZSH theme, further simplied from Minimal Zoo by s3ththompson.
Shows animal emoji followed by a %
sign, denoting the last return value (red for non-zero, green for zero):
🐌 %
🐚 %
🐑 %
🐁 %
def flatten(x, depth=-1): | |
"""Flattens a list of lists into a single list.""" | |
if depth == 0: | |
return x | |
if isinstance(x, list): | |
result = [] | |
for el in x: | |
if hasattr(el, '__iter__') and not isinstance(el, str): | |
result.extend(flatten(el, depth - 1)) | |
else: |
ZSH theme, further simplied from Minimal Zoo by s3ththompson.
Shows animal emoji followed by a %
sign, denoting the last return value (red for non-zero, green for zero):
🐌 %
🐚 %
🐑 %
🐁 %