def to_expr(term):
    """Convert to Expr from Term or Pauli operator (X, Y, Z, I).

    Args:
        term: (Term, X, Y, Z or I): A Term or Pauli operator.

    Returns:
        Expr: An `Expr` object.
    """
    return term.to_expr()