.. index:: py::builtins::operator < [py::builtins::list] .. _doxycast_pypp_namespacepy_1_1builtins_1abb277f3f80aa539c1607ed9f3a1b6ee4: .. _py-builtins-operator-less_than-list: *py::builtins::*\ operator < (:ref:`py::builtins::list `) =========================================================================== *Defined in* ```` .. code-block:: cpp template bool operator < (const list& lhs, const list& rhs); Checks whether a list is less than another list. Parameters ---------- ``lhs``: A list. ``rhs``: Another list. Return value ------------ Whether ``lhs`` is less than ``rhs``. Complexity ---------- :math:`O(n)`, where ``n = py::min(lhs.size(), rhs.size())``. Example ------- .. code-block:: cpp #include #include int main() { py::list lhs{0, 9, 1, 3}; py::list rhs{0, 9, 1, 4}; py::print(lhs < rhs); } **Output**: .. code-block:: text true