👤

what is the difference between statements, indentations, and comments in python?​

Sagot :

Answer:

Python Indentation

Most of the programming languages like C, C++, and Java use braces { } to define a block of code. Python, however, uses indentation. A code block (body of a function, loop, etc.) starts with indentation and ends with the first unindented line. ... Incorrect indentation will result in IndentationError .

Explanation:

indent attempts to distinguish between comments which follow statements, comments which follow declarations, comments following preprocessor directives, and comments which are not preceded by code of any sort, i.e., they begin the text of the line (although not necessarily in column 1).