+ 2
Guys..wat is indentation in python..and also y is it that certain amt of space is being left before writing certain code
4 odpowiedzi
+ 6
indentation creates spaces before text
indentation is used in all programming languages
Indentation is used as it makes code easier to read and is better to find parts of code when scrolling through
people made indentation as it is better for humans and makes life easier
indentation is used on a block of code so the block is as one part
for example
if x < 2
print “hi”
as shown the print part is indented
indenting spaces is 4 spaces before the text
+ 2
Indentation in Python is part of the syntax!
Changing the indentation may affect the BEHAVIOUR of your code
0
https://code.sololearn.com/cW61xkZFzS8J/?ref=app
typically your code here does not increment x each time because the last line misses indentation :)