Ask coding questions

← Back to all posts
Red Squiggly LInes
BataviaShaCon

How in the world do you fix errors properly in my students code? Many of the errors started off as indentation errors and when they go back and line everything up, they still get the errors. Can anyone advise me on how to help them out?

Voters
ljaemontefalcon
SophieWest
Javien16459
Kai_Justice
BataviaShaCon
Comments
hotnewtop
ElmaHaque

no

Kai_Justice

I suggest making sure that their indentation size is the same for each line, deleting the indentation for lines that have the problem. (Warning : doing so is extremely tedious and annoying, and has a chance of not working anyways.)
Good luck and hope you figure this out.

AdCharity

I assume it's python? I'd teach them proper indentation to start with, as well as simple debugging techniques (like how to find and locate errors). Also, if there are errors and it's not being caused by incorrect spacing, then it's likely because variables are out of scope/never defined, concepts are being applied incorrectly, among other things.

slip1244

you can batch indent or de indent things by highlighting groups of lines and doing tab or shift tab, if it makes it easier. either way you'll have to deindent and indent almost every line before python accepts the indentation because of its very bad system of defining code blocks.