Indentation in Python

Indentation in Python

Indentation in Python refers to the use of whitespace (spaces or tabs) at the beginning of a line to define the scope of code blocks. Python relies on indentation to indicate blocks of code, such as those for loops, if-else conditions, and functions.

  • Indentation levels must be consistent within a block.
  • we can use spaces or tabs for indentation, but mixing them in the same file is discouraged.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了