What is the use of indentation in python language? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the use of indentation in python language?

.

5th Mar 2021, 4:26 PM
Tony Stark
Tony Stark - avatar
2 Answers
+ 8
In most languages curly braces {} are used to define a scope (for loops, if statements etc), but in Python we use indentations. Example: while(True){ print("Hello") } # will print "Hello" infinitely.
5th Mar 2021, 4:44 PM
Artem 🇺🇦
Artem 🇺🇦 - avatar
+ 5
Indentation is very salient in Python - They are basically spaces which can represent a code block (4 spaces would be nice!) - Intentation can be seen in loops and function statements and it enhances readability too
5th Mar 2021, 4:44 PM
A C K
A C K - avatar