def digits(n, string=False):
    """Get the digits of a number as a list of numbers

    `string` if True, return a list of strings
    """
    if string:
        list_of_digits = [digit for digit in str(n)]
    else:
        list_of_digits = [int(digit) for digit in str(n)]
    return list_of_digits