from typing import Union


def tab(text:Union[list, str], pad="    ") -> Union[list, str]:
    """Adds a tab before each line. str in, str out. List in, list out"""
    if isinstance(text, str):
        return "\n".join([pad + line for line in text.split("\n")])
    else: return [pad + line for line in text]