In the posted question, it is ambiguous whether it's a logic error or a syntax error. Perhaps the indentation was meant that way but OP didn't realise the need for if..elif
statements to chain. Though having said that, realistically, we can all guess what was meant.
How is this different from other misplaced or missing braces?
if (foo)
bar();
baz();
Well, this doesn't work like most newbies expect either. Is that a logic issue, or a syntax issue?
When the code says one thing but the OP is clearly expecting it to behave differently than it does, and the reason for that dissonance is incorrect syntax… then closing it as such is warranted. The syntax of the language you're writing is the most basic skill you have to master first. If you're not aware of the importance of indentation in Python, or the use of braces in most other languages, you need to go back to the very basics of the language. These are not generally questions we want to entertain here, because there are an infinite number of ways in which you can typo syntax and each case almost never helps anyone else ever again.
The only exception to this I would say are situations with very non-obvious and subtle syntax issues. Something like the infamous -->
operator which comes up every so often; it's useful having one canonical answer for that.
{
?