def count_chars(text: str, include_spaces=False) -> int:
    """
    Count number of characters in a text.

    Arguments:
    ---------
    text: str
        Text whose words are to be counted.
    include_spaces: bool, default=False
        Count spaces as characters.

    Returns:
    -------
    Number of Characters: int
        Length of words in text.
    """
    if not isinstance(text, str):
        raise TypeError("Text must be in string format not {}".format(type(text)))

    if not include_spaces:
        text = text.replace(" ", "")  # replace space with no space

    return len(text)