rather than by repeatedly calling update(or add(in loop for example{ :chr( +ifor in range( ){ ' ' ' ' ' ' ' ' ' ' ' '{chr( +ifor in range( ){' '' '' '' '' '' 'the imperative versions of these comprehensions would look very similar to the examples shown earlier for other built-in datatypes recursion functional programmers often put weight in expressing flow control through recursion rather than through loops done this waywe can avoid altering the state of any variables or data structures within an algorithmand more importantly get more at the "whatthan the "howof computation howeverin considering using recursive styles we should distinguish between the cases where recursion is just "iteration by another nameand those where problem can readily be partitioned into smaller problemseach approached in similar way there are two reasons why we should make the distinction mentioned on the one handusing recursion effectively as way of marching through sequence of elements iswhile possiblereally not "pythonic it matches the style of other languages like lispdefinitelybut it often feels contrived in python on the other handpython is simply comparatively slow at recursionand has limited stack depth limit yesyou can change this with sys setrecursion limit(to more than the default but if you find yourself doing so it is probably mistake python lacks an internal feature called tail call elimination that makes deep recursion computationally efficient in some languages let us find trivial example where recursion is really just kind of iterationdef running_sum(numbersstart= )if len(numbers= print(return total numbers[ start print(totalend="running_sum(numbers[ :]totalrecursion