mercredi 21 juin 2017

Avoid indentation in else and elif

In writing if condition, we must have an indentation for each line inside it. But the else and the elif part must be aligned with if. However when I type else: or elif: in a newline, it has an indentation and I must remove it manually. I have seen it in several IDEs like Wing.

Is there any way to avoid indentation for else and elif? Indeed I need this:

if (condition):
    do this
else:
    do this

But when I type it, it's like:

if (condition)
    do this
    else:
    do this

Aucun commentaire:

Enregistrer un commentaire