Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (55.6k points)

Can anyone explain the indentation in python?

1 Answer

0 votes
by (119k points)

Indentation in Python represents spaces or tabs that are present at the starting of that line of code. If two lines of codes have the same indentation, it represents those two lines belong to the same group. 

In the following example, first-line and fifth line, 2nd and 3rd lines come under the same group since they have the same indentation

if a==1:

print(a)

                if b==2:

                               print(b)

print("end")

If you want to learn Python, you can check out this Python Certification program by Intellipaat that provides Instructor-led training, hands-on experience, and certification also.

You can watch this video on Python for beginners to learn the basic syntax of python:

Related questions

0 votes
1 answer
asked Mar 23, 2021 in Python by Rekha (2.2k points)
+1 vote
1 answer
asked Aug 3, 2019 in Python by Sammy (47.6k points)

Browse Categories

...