Ask me anything about your lessons or your code.
“What is a port?” · “Why is my code erroring?”
A bug is the gap between what code does and what it was meant to do, and every hunt is a search for the one spot where they split.
What a Bug Really Is
A bug is the gap between what code does and what it was meant to do, and every hunt is a search for the one spot where they split.
Print Debugging and the Debugger
A bug hides where the code's real behavior and the mental model disagree, so the fix is to make the real behavior visible.
What a Test Is
Fixing a bug by hand once is fine; a test proves it stays fixed, forever, without anyone watching.
Writing Tests With pytest
Hand-run assert checks work for one function; pytest runs a whole suite and tells you exactly which case broke.
Edge Cases and Thinking Like a Tester
Knowing how to write a test is the easy half; knowing which inputs will break the code is where bugs get caught.