We can indent code in Python by selecting the lines that we want to indent and by pressing the “Tab” key. Now, if we want to unindent a block of code, then we can do it by selecting the lines and by pressing the “Shift” + “Tab” keys. To sum up:
- Indent Code: Press the “Tab” key
- Unindent Code: Press the “Shift” + “Tab” keys