.. index:: py::builtins::operator != [py::builtins::range] .. _doxycast_pypp_namespacepy_1_1builtins_1aaaf85cbc00a979097ace822f43892247: .. _py-builtins-operator-not_equals-range: *py::builtins::*\ operator != (:ref:`py::builtins::range `) ============================================================================== *Defined in* ```` .. code-block:: cpp template constexpr bool operator != (const range& lhs, const range& rhs); Compares two ranges for inequality. .. note:: Ranges are compared by the values hold by range, not by specifications of them for example ``range(0, 4, 2) != range(0, 3, 2)`` returns ``false``. Parameters ---------- ``lhs``: A range. ``rhs``: Another range. Return value ------------ Whether ``lhs`` is not equal to ``rhs``. Complexity ---------- :math:`O(n)`, where ``n = py::min(lhs.size(), rhs.size())``. Example ------- .. code-block:: cpp #include #include int main() { py::range lhs(0); py::range rhs(4, 0); py::print(lhs != rhs); } **Output**: .. code-block:: text false