.. _else-if-used: else-if-used / R5501 ==================== **Message emitted:** ``Consider using "elif" instead of "else" then "if" to remove one indentation level`` **Description:** *Used when an else statement is immediately followed by an if statement and does not contain statements that would be unrelated to it.* **Problematic code:** .. literalinclude:: /data/messages/e/else-if-used/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/e/else-if-used/good.py :language: python **Configuration file:** .. literalinclude:: /data/messages/e/else-if-used/pylintrc :language: ini .. note:: This message is emitted by the optional :ref:`'else_if_used'` checker, which requires the ``pylint.extensions.check_elif`` plugin to be loaded. Created by the `else_if_used `__ checker.