Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Have students pay special attention to “off by one” bugs to help them avoid common mistakes in their code.

Share Have students pay special attention to “off by one” bugs to help them avoid common mistakes in their code. with FacebookShare Have students pay special attention to “off by one” bugs to help them avoid common mistakes in their code. with Twitter
  • These are errors that do not account for edge cases; most frequently, the first or last element.

More about this tip

Tags

  • Development Methods
External Source

Interview with Jim Huggins

Other Tips By
Other Tips By Jim Huggins

Similar tips

When a student gets stuck on syntax, like a missing semicolon, just fix it for them so they don’t become frustrated.
Reinforce that certain types in Python such as lists are mutable while others (e.g. strings, tuples) are not. Students have difficulty tracing code that uses mutable types because they often forget this.
Have students trace loops with break statements to reinforce the behavior of break because tracing is a powerful and straight-forward exercise.
  • CSTT Facebook
  • CSTT Twitter

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Footer Icons by Mohammed Alyousfi. Powered by Drupal.

Privacy Policy

  • National Science Foundation
  • Sage Fox Group
  • Harvey Mudd College