Interview Question

What is indentation in Python?

Python uses indentation to define code blocks.

💡 Concept ✅ Quick Revision 🐍 Python

Answer

Indentation is part of Python’s syntax for grouping statements into blocks. β€’ Statements at the same indentation level belong to the same block. β€’ The standard style uses four spaces per indentation level. β€’ Mixing tabs and spaces inconsistently can cause errors.

💡 Simple Example

if True: print('inside the block')

Output

inside the block

⚡ Quick Revision

Python uses indentation to define code blocks.