Differences between revisions 2 and 16 (spanning 14 versions)
Revision 2 as of 2004-12-21 01:35:21
Size: 2751
Editor: pcp07851797pcs
Comment:
Revision 16 as of 2020-08-19 21:53:55
Size: 3429
Editor: ChrisM
Comment: Fix grammar mistakes
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Moved from the educational wikis at http://coedit.net/ to here:
Line 4: Line 2:

* The [http://www.alice.org/ Alice] 3D project developed a 3D programming environment for beginners. They used ["Python"] as the programming language originally (now switched to something else). There were two Python-specific issues that were problematic for beginners: the case-sensitivity of the language ("variable1" is not the same as "Variable1"), and integer division (a carryover from C, 3/4 = 0, not 0.75 because 0 is an integer and 0.75 is a float). The latter issue has been fixed, but the former has not and very likely never will. See this [http://www.linuxjournal.com/article.php?sid=5028 interview] in Linux Journal and this [http://www.alice.org/advancedtutorial/ConwayDissertation.PDF dissertation] for more details.
  * I have patches to implement both of these features in the [http://boo.codehaus.org/ Boo] programming language, which is virtually identical to Python, and they will appear in a release of boo in the near future.

 * This article (
[http://www.onlamp.com/pub/a/python/2004/02/05/learn_python.html Common Mistakes of Python Programmers]) lists other common errors seen in Python training classes. Many result from the use of Python's interactive prompt and the IDLE text-based python development environment. Some of these problems might be solved by using IPython instead, but in general I never used (nor currently use) python's interactive prompt to develop applications.

 * Another common error mentioned in the above article is forgetting to add a colon (:) at the end of if statements, class declarations, etc.  

 * Even for advanced users there are features of the Python language that can cause difficulties. See [http://zephyrfalcon.org/labs/python_pitfalls.html 10 Python pitfalls] and [http://www.amk.ca/python/writing/warts.html Python warts].
 * The [[http://www.alice.org/|Alice]] 3D project developed a 3D programming environment for beginners. They used [[Python]] as the programming language originally (now switched to something else). There were two Python-specific issues that were problematic for beginners: the case-sensitivity of the language ("variable1" is not the same as "Variable1"), and integer division (a carryover from C, 3/4 = 0, not 0.75 because 0 is an integer and 0.75 is a float). The latter issue has been fixed, but the former has not and very likely never will. See this [[http://www.linuxjournal.com/article.php?sid=5028|interview]] in Linux Journal and this [[http://www.alice.org/wp-content/uploads/2017/04/ConwayDissertation.pdf|dissertation]] for more details.
  * DougHolton is said to have patches to implement both of these features in the [[http://boo-lang.org/|Boo]] programming language, a language with similarities to
Python, and they will appear in a release of Boo in the near future.
 * This article ([[http://www.onlamp.com/pub/a/python/2004/02/05/learn_python.html|Common Mistakes of Python Programmers]]) lists other common errors seen in Python training classes. Many result from the use of Python's interactive prompt and the IDLE text-based Python development environment. Some of these problems might be solved by using IPython instead, but in general I never used (nor currently use) python's interactive prompt to develop applications.
 * Widely known as the "No Module named..." error, this is an issue all programmers face at some point (sometimes multiple times). This article([[https://coderslegacy.com/python-no-module-named-import-error/|The "No Module Named" Error]]) addresses this issue, going through every possible scenario in which this error occurs and how to avoid running into it again.
 * Another common error mentioned in the above article is forgetting to add a colon (:) at the end of if statements, class declarations, etc.
 * Subtle errors--which may cause some fairly difficult to follow messages--happen when built-in type and function names are "shadowed" (ie. redefined). For example, using `str` as a variable name in a scope (ie. a function or class) will prevent the built-in function of the same name from being usable, producing an error like this: `TypeError: 'str' object is not callable`
 * Even for advanced users there are features of the Python language that can cause difficulties. See PythonWarts for resources and observations on such matters. These observations have in part been used to suggest refinements in future Python versions.
 * Some
[[Intermediate Conundrums]] have been noted with regard to the behavior of some Python features, although these may be outside the scope of beginner problems.
Line 16: Line 12:
 * The [[http://pychecker.sourceforge.net/|PyChecker]] module can alert users to many common errors. There also is a tool called [[https://www.pylint.org/|PyLint]].
Line 17: Line 14:
 * The [http://pychecker.sourceforge.net/ PyChecker] module can alert users to many common errors. There also is a tool called [http://www.logilab.org/projects/pylint PyLint].  * To see languages that have been used successfully with beginners and children, see Logo, HyperTalk (used in HyperCard and SuperCard), HTML, JavaScript, variants of Basic, etc.
Line 19: Line 16:
 * To see languages that have been used successfully with beginners and children, see Logo, !Hyper''''''Talk (used in Hyper''''''Card and Super''''''Card), HTML, Java''''''Script, variants of Basic, etc.  * Are students learning python to "learn to program" or to develop real applications? Does the IDLE interactive prompt help or hinder either?
Line 21: Line 18:
 * Are students learning python to "learn programming" or to develop real applications? Does the IDLE interactive prompt help or hinder either? See http://developers.coedit.net/StudentsDevelopingEducationalSoftware for examples of students doing real application development and Rapid''''''Prototyping (although these are college students and in some cases CS majors who already know how to program).
== Notes ==
This page was moved from the educational wikis at ''coedit.net'' to here.

Common Problems Beginners Have

  • The Alice 3D project developed a 3D programming environment for beginners. They used Python as the programming language originally (now switched to something else). There were two Python-specific issues that were problematic for beginners: the case-sensitivity of the language ("variable1" is not the same as "Variable1"), and integer division (a carryover from C, 3/4 = 0, not 0.75 because 0 is an integer and 0.75 is a float). The latter issue has been fixed, but the former has not and very likely never will. See this interview in Linux Journal and this dissertation for more details.

    • DougHolton is said to have patches to implement both of these features in the Boo programming language, a language with similarities to Python, and they will appear in a release of Boo in the near future.

  • This article (Common Mistakes of Python Programmers) lists other common errors seen in Python training classes. Many result from the use of Python's interactive prompt and the IDLE text-based Python development environment. Some of these problems might be solved by using IPython instead, but in general I never used (nor currently use) python's interactive prompt to develop applications.

  • Widely known as the "No Module named..." error, this is an issue all programmers face at some point (sometimes multiple times). This article(The "No Module Named" Error) addresses this issue, going through every possible scenario in which this error occurs and how to avoid running into it again.

  • Another common error mentioned in the above article is forgetting to add a colon (:) at the end of if statements, class declarations, etc.
  • Subtle errors--which may cause some fairly difficult to follow messages--happen when built-in type and function names are "shadowed" (ie. redefined). For example, using str as a variable name in a scope (ie. a function or class) will prevent the built-in function of the same name from being usable, producing an error like this: TypeError: 'str' object is not callable

  • Even for advanced users there are features of the Python language that can cause difficulties. See PythonWarts for resources and observations on such matters. These observations have in part been used to suggest refinements in future Python versions.

  • Some Intermediate Conundrums have been noted with regard to the behavior of some Python features, although these may be outside the scope of beginner problems.

Comments, Potential Solutions

  • The PyChecker module can alert users to many common errors. There also is a tool called PyLint.

  • To see languages that have been used successfully with beginners and children, see Logo, HyperTalk (used in HyperCard and SuperCard), HTML, JavaScript, variants of Basic, etc.

  • Are students learning python to "learn to program" or to develop real applications? Does the IDLE interactive prompt help or hinder either?

Notes

This page was moved from the educational wikis at coedit.net to here.

BeginnerErrorsWithPythonProgramming (last edited 2021-01-31 19:34:47 by MatsWichmann)

Unable to edit the page? See the FrontPage for instructions.