[Type A] Python Revision Tour-1 – Chapter 1
Table of Contents
12. Describe the concepts of block and body. What is indentation and how is it related to block and body?
A block is a group of statements in a program that are executed together. A body is a part of a block or a function definition that contains the executable code.
Indentation refers to the spaces or tabs used at the beginning of a line to define the structure of the code. In Python, indentation is significant as it is used to define blocks of code. Blocks are defined by indentation level, and each block can contain multiple statements.