Difference between revisions of "Python:Common Mistakes"

From PrattWiki
Jump to navigation Jump to search
(Created page with "==Overview== This page is designed as a resource for new programmers learning Python for [http://pundit.pratt.duke.edu/wiki/EGR_103/Spring_2020 EGR 103]. If you are an experi...")
 
(additional descriptions added)
Line 5: Line 5:
 
==Problems with Variables==
 
==Problems with Variables==
  
These are problems involving the use, saving, and manipulation of variables, often encountered during the first 3 labs of [http://pundit.pratt.duke.edu/wiki/EGR_103/Spring_2020 EGR 103].
+
These are problems involving the use, saving, and manipulation of variables, often encountered during the first half of the labs in [http://pundit.pratt.duke.edu/wiki/EGR_103/Spring_2020 EGR 103].
  
 
===Assignment vs. Accessing===
 
===Assignment vs. Accessing===
Line 17: Line 17:
  
 
==Problems with Methods==
 
==Problems with Methods==
 +
These are problems involving the writing and use of methods, often encountered during the second half of the labs in [http://pundit.pratt.duke.edu/wiki/EGR_103/Spring_2020 EGR 103].
  
 
===Printing vs. Returning===
 
===Printing vs. Returning===
Line 25: Line 26:
  
 
==Miscellaneous==
 
==Miscellaneous==
 +
These are other logic errors or configuration problems you may encounter, as well as some useful debugging practices.
  
 
===For Loops vs. For-Each Loops===
 
===For Loops vs. For-Each Loops===

Revision as of 21:31, 15 January 2020

Overview

This page is designed as a resource for new programmers learning Python for EGR 103. If you are an experiencing an error with which you are not familiar, check the common mistakes below first.

Problems with Variables

These are problems involving the use, saving, and manipulation of variables, often encountered during the first half of the labs in EGR 103.

Assignment vs. Accessing

Calculating in a Vacuum

Mutable and Immutable Data Types

Problems with Methods

These are problems involving the writing and use of methods, often encountered during the second half of the labs in EGR 103.

Printing vs. Returning

Methods that Return and Methods that Modify

Miscellaneous

These are other logic errors or configuration problems you may encounter, as well as some useful debugging practices.

For Loops vs. For-Each Loops

See also: Enumerate

Testing Your Code

Network Errors

Variable Explorer

Renaming Existing Variables