def validate_is_string_or_number(var):
    """
    Checks if the input is either a str, int or float.

    :param var: input
    :raises: TypeError if not
    :returns: True
    """
    valid_types = str, int, float
    if not isinstance(var, valid_types):
        raise TypeError('Input is not a string or a number:' + str(var))
    return True
