How do I unindent using IDLE (Python gui)

Try typing it like this. You'll notice the cursor moves to the start of the line after the pass

>>> if x == 0:
        x = 0
        print('Negative changed to zero')
        pass
elif x == 0:
    print('other stuff')

Ctrl+[ should do the trick for unindenting.

Conversely, you can indent with Ctrl+], but IDLE generally handles indenting much better than unindenting.


ctrl + [ in Windows

command + [ in Mac


Backspace works for me.

If you go to Options->Configure IDLE and click on the Keys tab, what options are selected? It might make a difference - I have IDLE Classic Windows.