Python Forum

Full Version: Want to print each iteration of factorial program
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
There is famous saying: "in order to understand recursion you must first understand recursion". My advice is not to concentrate to recursion at the beginning of your learning process.

I am not alone in this Smile. From Guido van Rossum's 'Tail recursion elimination':

Quote:I don't believe in recursion as the basis of all programming. This is a fundamental belief of certain computer scientists, especially those who love Scheme and like to teach programming by starting with a "cons" cell and recursion. But to me, seeing recursion as the basis of everything else is just a nice theoretical approach to fundamental mathematics (turtles all the way down), not a day-to-day tool.
/.../
Python-style lists (which are flexible arrays, not linked lists), and sequences in general, are much more useful to start exploring the wonderful world of programming than recursion. They are some of the most important tools for experienced Python programmers, too. Using a linked list to represent a sequence of value is distinctly unpythonic, and in most cases very inefficient. Most of Python's library is written with sequences and iterators as fundamental building blocks (and dictionaries, of course), not linked lists, so you'd be locking yourself out of a lot of pre-defined functionality by not using lists or sequences.

Learning can be cognitively seen as Bloom's taxonomy:

Knowledge -> Comprehension -> Application -> Analysis -> Synthesis -> Evaluation

So I advise to learn, understand and apply your knowledge. Formulate problem in spoken language, state solution in spoken language and translate it into Python.

You can participate (free of charge) Python courses in edX.org.
Pages: 1 2