def positive_real_zero(var, var_name):
    """
    Check if parameter *var* is a positive number or zero.

    :raises TypeError: Parameter *var* must be a real number.
    :raises ValueError: Parameter *var* must be a positive number or zero.
    """
    if not isinstance(var, (int, float)):
        raise TypeError('\n\nParameter {} must be a real number.\n'.format(
            var_name))
    if var < 0:
        raise ValueError(
            '\n\nParameter {} must be a positive number  or zero.\n'.format
            (var_name))
