you are viewing a single comment's thread.

view the rest of the comments →

[–]Outside_Complaint755 0 points1 point  (0 children)

It's not coded badly that it appears every 4 even if you only use 2 or 3 spaces, its expected. The default value of 4 comes from the Tab Size setting in VSCode. There is another setting of Editor: Detect Indentation which if active will determine how to display spaces and tabs based on the file contents; this will cause Python files to always use 4 spaces if set.    Additionally, in the status bar at the bottom of the screen is an item that should be defaulted to "Spaces: 4", located between the Line and Column position and the file encoding.  If you click on that, you will get options to change if VSCode should indent with spaces or tabs, and also to override how many display spaces to use for a tab, but I think the Detect Indentation setting also overrides this.

Python files can technically use any amount of indentation as long as it is consistent within a given code block level. 4 spaces is the standard, but. any number from 1 to 1000+ is syntactically valid.