Python Forum
Want to print each iteration of factorial program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Want to print each iteration of factorial program
#11
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.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UnicodeEncodeError caused by print when program runs from Popen SheeppOSU 5 2,910 Jan-13-2022, 08:11 AM
Last Post: SheeppOSU
  Comparing recursion and loops using two scripts (basic factorial) Drone4four 3 2,237 Oct-11-2020, 06:48 PM
Last Post: deanhystad
  Python factorial code timebrahimy 4 67,837 Sep-27-2020, 12:23 AM
Last Post: timebrahimy
  factorial, repeating Aldiyar 4 2,791 Sep-01-2020, 05:22 PM
Last Post: DPaul
  factorial using recursive function spalisetty06 12 4,051 Aug-25-2020, 03:16 PM
Last Post: spalisetty06
  minor mistake in code for factorial spalisetty06 2 1,877 Aug-22-2020, 05:00 PM
Last Post: spalisetty06
  Help with getting sub-program to print text djwilson0495 2 1,893 Aug-16-2020, 05:03 PM
Last Post: deanhystad
  Factorial Code is not working when the given number is very long integer Raj_Kumar 2 2,294 Mar-31-2020, 06:40 PM
Last Post: deanhystad
  Factorial sketch(python 3) KingArthur526 1 1,969 Sep-25-2019, 01:51 PM
Last Post: ichabod801
  Factorial leodavinci1990 8 4,418 Jul-19-2019, 10:59 PM
Last Post: leodavinci1990

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020