Change indentation level in Google Colab

zabop picture zabop · Mar 3, 2019 · Viewed 7.6k times · Source

I am using Google Colaboratory to write Python code in their notebook. Whenever I hit an enter after a for loop definition or in a try-except block, the new line is automatically indented, which is good, but it uses only 2 whitespaces by default. This is contrary to PEP-8 standard.

Why is this the case and how can I change this setting?

Answer

Mohammed Awney picture Mohammed Awney · Sep 3, 2019

you can change it to 4 white-spacesenter image description here