:orphan: Nested Loops =================== Nested loops are a challenging technique in programming, yet one of the most versatiles ones. With nested loops we can scan through large and complex arrangements of data, perform repetitive tasks, compute useful and interesting formulas, etc. A simple problem ++++++++++++++++ Compute the sum of :math:`M` integers, beginning with :math:`N`. For example, if :math:`M=5` and :math:`N=0`, the sum to compute is .. math:: \underbrace{ \underbrace{0}_{N} + 1 + 2 + 3 + 4 }_{M=5\ \text{numbers}} = 10 The relevant code is shown below and the full code is available on `GitHub `_. A method takes two arguments, the beginning number :math:`N` and how many subsequent integers to add, :math:`M`. Then it builds a loop beginning at :math:`i=N` and continuing while :math:`i