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

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