57gg
last updated 2 years ago by mtobis #
I like the basic idea.
I might recommend adding a fourth, Python as a First Language category. Beginners who are already programmers will have different needs than beginners who are non-programmers.
I have been teaching Python as a first language based on the presumption that beginners do not need to know about floats, and certainly complex numbers do not need to enter into it.
I introduce integers, strings, lists, for loops, print, and the range and type built-ins. It is then possible to demonstrate solving a reasonably complicated problem. I have since then proceeded to function definitions and imports.
Many of the other things that are typically taught at the beginning can be profitably deferred. Operator precedence is a big one. I recommend avoiding floats at first because they are somewhat different beasts than what they seem to be. Explaining them properly is quite involved, and explaining them inadequately can be a disservice.
My basic design decision was to find the minimal subset of Python that could be used to solve interesting problems.
I am currently in a bit of a tangle trying to make clear what the "return" statement does.
I absolutely urge that installation of Python NOT be included as the first chapter of the beginner's tutorial. It should just say "if Python is not installed on your computer, read first".
I do think a clear explanation of the distinction between interactive mode and command-line mode is important to put early in the document, and somewhat problematic for the true beginner. I rather wish that the behavior of the interactive mode to print non-None returns were not there at least by default; it presents a messy implementation detail that is hard to grasp at first.

Thanks!
Agreed. 'First Language Users' are an important constituency. I've only ever skimmed through Swaroop's 'A Byte of Python' but it seems to get a good press, though it's a bit more than the 'minimal subset' approach that you mention.
I've had the same thought myself. Will try to think of an alternative intro.
Thanks for the interesting comments.
Gerard
gerard 2 years ago #