An indentation style generally specifies a consistent number of whitespace characters before each line of a block, so that the lines of code appear to be related, and dictates whether to use spaces or tabs as the indentation character. However, copying and pasting indented code can cause problems, because the indent level of the pasted code may not be the same as the indent level of the target line. The following is an example of indentation blocks in python In python, the rule is taken to define the boundaries of statements rather than declarations. Typically, the lines of a block are aligned with an amount of white space that indicates the block's depth in the hierarchical structure of the code. The rules a compiler applies to the source creates implicit standards
For example, python code is much more consistently indented than, say perl, because whitespace (indentation) is actually significant to the interpreter Python does not use the brace syntax perl uses to delimit functions. Python was designed to be a highly readable language [1] it has a relatively uncluttered visual layout and uses english keywords frequently where other languages use punctuation Python aims to be simple and consistent in the design of its syntax, encapsulated in the mantra there should be one— and preferably only one —obvious way to do it, from the zen of python Its design philosophy emphasizes code readability with the use of significant indentation
The zen of python is a collection of 19 guiding principles for writing computer programs that influence the design of the python programming language [1] python code that aligns with these principles is often referred to as pythonic. Examples include python and text files that require indentation as a rule by themselves
OPEN