0% found this document useful (0 votes)
48 views

Lesson 13 - Debugging & Bifs

This document discusses debugging techniques in Python including recognizing bugs, fixing syntax errors through documentation, finding conceptual errors by tracing programs and adding print statements, and using built-in functions. Resources for debugging include the Python documentation, which thoroughly explains everything, and Google, which provides quick solutions but may not be best practices. Built-in functions are pre-defined in Python and information about their inputs, outputs, and usage can be found in documentation and online.

Uploaded by

raasiboi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Lesson 13 - Debugging & Bifs

This document discusses debugging techniques in Python including recognizing bugs, fixing syntax errors through documentation, finding conceptual errors by tracing programs and adding print statements, and using built-in functions. Resources for debugging include the Python documentation, which thoroughly explains everything, and Google, which provides quick solutions but may not be best practices. Built-in functions are pre-defined in Python and information about their inputs, outputs, and usage can be found in documentation and online.

Uploaded by

raasiboi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lesson 13 Debugging & BIFs

Debugging
1)
2)
3)
4)

Recognize the bug


Determine TYPE of bug
FIND the bug
CRUSH THE BUG

Syntax Errors
-

Python IDLE will tell us where to look

How do we fix them?


-

Find the correct syntax via Python Documentation or Google

Common examples:
-

Incorrect indentation
Missing colons ( : )
Missing parenthesis ()

Conceptual and Other errors


How do we find them?
Program yields unexpected results
How do we fix them?
-

Find the source of error by tracing thru program & adding print
statements to program if necessary.
Restructure algorithm

Common examples:
-

Incorrect if-statements
Infinite loops
Incorrect/Problem for algorithm

Resources
Python documentation

Advantages
-

Thorough explanation of EVERYTHING Python


Can find ALL possible approaches to a particular problem

Disadvantages
-

Can be difficult to understand

Google
Advantages
-

Quick and dirty solution to a problem


Useful for quick syntax fixes

Disadvantages
-

Solution may not be BEST solution


Information limited to what users contribute
(Especially on stackoverflow)

BIFs (Built-in Functions)


E.g print, reversed, sum, round etc.

We can learn about BIFs from:


-

Python Documentation
Google

Important to note:
-

Input parameters and types


Return types

You might also like