from typing import List
from typing import Any


def columns(table: List[List[Any]]) -> List[List[Any]]:
    """Returns a list with the columns of a table.

    Args:
        table (List[List[Any]]): The table. Needs to be a n x m matrix.

    Returns:
        List[List[Any]]: The columns of the table.

    Raises:
        ValueError: if `table` is no n x m matrix.
    """
    for i in range(len(table)):
        if len(table[0]) != len(table[i]):
            raise (ValueError("Table needs to be a n x m matrix."))
    row_iter = range(len(table))
    col_iter = range(len(table[0]))
    return [[table[row][col] for row in row_iter] for col in col_iter]