Issue
Is there any shortcut to automatically indent marked lines in the editor? For example, in MATLAB there is the CTRL+I shortcut.
Solution
Matlab's syntax can match the opening closing statements of if
,while
, for
etc. by looking for end
statements.
In Python these are ambiguous and defined as the nested indentetation. Hence this cannot be reliably implemented as you cannot decide whether the succeeding if
block belongs the the current for
loop or it is the next block, if not indented properly.
If indented properly then Forzaa's answer is the answer otherwise the code is useless anyway and needs to be debugged.
Answered By - percusse
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.