CS 1110 Lecture Notes - Lecture 9: Unit Testing, If And Only If
Document Summary
Visualization tools show the current flow for the error. No requirements on how to implement your traces. Traces show where in the program you are using print statement. Do whatever is easiest for you to see the flow. Comment out print statements when you are done. Never refer to a variable that might not exist. Block (indented group) where it was first assigned. Way to think of variables; not actually part of python. Despite the fact that return will end the if function, no two returns will happen at the same time. As soon as the first boolean expression is true, the if/elif/else statement executes and the function ends. The output returns on which boolean is true first. Algorithm: a step by step procedure for how to do something (usually calculation) Implementation: how to write an algorithm in a specific programming language. Good programmers know how to separate the two. Work out algorithm on paper or in head.