Current location - Education and Training Encyclopedia - Graduation thesis - When writing python program code, indentation format is only used for typesetting, right?
When writing python program code, indentation format is only used for typesetting, right?
That's not true. Python requires that code blocks be represented grammatically in indented format. Indentation is the most basic structure in Python grammar. Indentation is added at the beginning of each code block and decreased at the end of the code block. The advantage of this grammar is that it makes the code clearer and easier to read, and avoids the problems caused by symbols such as curly braces that are common in other languages.