.. index:: py::builtins::range::step .. _doxycast_pypp_classpy_1_1builtins_1_1range_1a280c47caa5b491b9c212836b1585a679: .. _py-builtins-range-step: *py::builtins::range::*\ step ============================= .. code-block:: cpp constexpr const long& step() const; Returns the step value of the range. The step value defines the difference between two values. This defines how much to add to a value to get the next one. .. note:: The value of this variable is always a non-zero integer. Return value ------------ The step value of the range. Complexity ---------- Constant. Example ------- .. code-block:: cpp #include #include int main() { py::range nums(10, 20, 2); py::print(nums.step())); } **Output**: .. code-block:: text 2