[New-bugs-announce] [issue20496] function definition tutorial encourages bad practice
report at bugs.python.org
Mon Feb 3 06:09:47 CET 2014
New submission from Alan Isaac:
Section 4.6 of the tutorial introduces function definition:
The first example defines a function that *prints* a Fibonacci series.
A basic mistake made by students new to programming is to use a function to print values rather than to return them. In this sense, the example encourages bad practice and misses an opportunity to instruct. Since they have already met lists in Section 3, I suggest that returning a list of the values and then printing the list would enhance the tutorial.
assignee: docs at python
nosy: aisaac, docs at python
title: function definition tutorial encourages bad practice
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce