When I create a function, the line right after the function does not automatically get indented. How can I do that?
def test_function():
print("I do not get an automatic indent for this line")
#When I press enter it takes me back to this spot for the previous line
edit (Sorry for not being clear. I am coding in python 3 and in PyCharm)
In my version of Pycharm (2019.3.2), you can go to File -> Settings
, search for "Smart indent", and find the corresponding check box. If you enable, it will maintain indentation after hitting enter.
If the search in Settings isn't working for some reason, the full path is:
File -> Settings -> Editor -> General -> Smart Keys
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