I want to write the following statment in IDLE (Python GUI)
>>> if x == 0: ... x = 0 ... print('Negative changed to zero') ... elif x == 0:
How can I get the unindention for the elif statment ?
Some additional facts:
Thanks.
Sorry, you should just use backspace, thing is that ">>>" does not intent on indentation. That means that in:
>>> if x == 54: x = 4 elif y = 4: y = 6
elif is just as indented as the if statment.
Sorry to waste your time..., although you can blame the IDE for making an un-selfexplanitory UI.
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.
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')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With