Step 3: Identify and Fix
In the previous lesson, you set a breakpoint and started debugging your code using the IDLE debugger. In this lesson, you will identify what the error is and try to make a change to see whether you can fix it. Now, you’ve figured out that something’s happening in here when instead of adding to the
new_word variable, you are actually replacing it. So at this point, you can conclude that this is what’s happening: instead of concatenating the string, you are replacing the string.
It’s time to apply a fix to the problem that you’ve identified. Instead of replacing
new_word with the current character and an underscore, you want to replace it with the current value of
new_word, plus the character plus an underscore.
01:08 So at this point, you’ve identified the problem and you’ve applied a fix to it. You hope that it’s a good fix that will actually take care of the bug that you had in the program before. But in order to know for sure, you will have to advance to step number four of your debugging process, which you will do in the next lesson.
Become a Member to join the conversation.