Which of the following is used to define a block of code in Python language?
A. Indentation
B. Key
C. Brackets
D. All of the mentioned
Answer: Option A
Solution (By Examveda Team)
In Python language, a block of code is defined using Indentation.Indentation refers to the spaces or tabs that precede statements within a block of code. In Python, indentation is used to define the structure and hierarchy of code blocks, such as those within functions, loops, conditional statements, and classes. Proper indentation is crucial for Python's syntax and readability. Unlike some other programming languages that use braces or brackets to denote code blocks, Python relies solely on indentation to indicate the beginning and end of blocks. This consistent indentation style helps improve code readability and maintainability.
Related Questions on Introduction to Python
What is Python primarily used for?
A. Web browsing
B. Data analysis
C. Video editing
D. Game development
Who developed Python Programming Language?
A. Wick van Rossum
B. Rasmus Lerdorf
C. Guido van Rossum
D. Niene Stom
Which of the following is an advantage of Python?
A. It compiles to machine code
B. It enforces strict typing
C. It has a large standard library
D. It requires extensive memory management
What is the role of the Python interpreter?
A. To convert Python code to assembly language
B. To manage memory allocation
C. To execute Python code line by line
D. To compile Python code into bytecode

Join The Discussion