Indentation in python

in this tutorial you will learn about python indentation which is used to represent block of statement in python programming.

  • Most of the programming language like C, C++, Java uses braces {} to define block of statement.
  • Python uses identation for define block of statement.
  • It start with indentation and ends with first unintended line.

Example:

if i==5:
   print(i)
      for i in range(1,10):
         print(i)
  • Incorrect indentation will result into indentation error.
Was this article helpful?
YesNo

Leave a Comment