0
Is the code inside an if/else statement indented with tab or space?
6 Antworten
+ 1
Either, but 'spaces' preferred (from Python's style guides):
https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
Highlights differences between 3.x and 2.x and basically recommends readable (not foolish) consistency...if you back up and read a section above:
https://www.python.org/dev/peps/pep-0008/#id15
+ 1
A tab is recognized differently than spaces. Using a text editor or IDE, you are able to assign the tab button to a certain number of spaces (good practice says to use 4). so while you are pressing tab, your editor is actually using a number of spaces instead. :)
0
you can use tab or a number of spaces. But in whole block inside the same
0
4 spaces for indentation is suggested for Python
0
when ever u want indentation tin program use tab key.
0
Best Solution for this is
you just use Sublime text editor this was awesome editor for Python
There is option like Tab Indentation or Space Indentation Just select it.