From the course: Programming Foundations: Beyond the Fundamentals
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Debugging without error messages - Python Tutorial
From the course: Programming Foundations: Beyond the Fundamentals
Debugging without error messages
- Sometimes error messages are very descriptive and sometimes they're more vague, but it's also possible to have an error without an error message. In the count.py file, I don't have any squiggles indicating errors in the code. The idea here is that my loop will count down from 10 and print each number to the terminal until it hits zero. So I'm going to run that at the terminal and I get the message saying which file was executed but that's it. No other output. Here, the code is being correctly interpreted but the results aren't what I expect. In this situation, the debugging is all on me. I need to think through my code from the computer's point of view and identify where the code is different from the instructions I meant to give. I'm starting with an I value of 10. And then I'm looping for as long as I is less than zero. Now the starting value of 10 is not less than zero, and that means the statements in the loop…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.