.. index:: py::builtins::list::begin .. _doxycast_pypp_classpy_1_1builtins_1_1list_1a4d359619d89bf0575e68b396d5baad8e: .. _py-builtins-list-begin: *py::builtins::list::*\ begin ============================= .. code-block:: cpp iterator begin(); // 1 const_iterator begin() const; // 2 1. Returns an iterator to the first element. 2. Returns a constant iterator to the first element. .. tip:: \(2) is equivalent to :ref:`py-builtins-list-cbegin`. .. graphviz:: ../assets/range-begin-end.dot Return value ------------ 1. An iterator to the first element. 2. A constant iterator to the first element. Complexity ---------- Constant. Example ------- .. code-block:: cpp #include #include int main() { py::list list = {0, 0, 1, 3}; py::print(*list.begin()); } **Output**: .. code-block:: text 0