+ 2

Guys..wat is indentation in python..and also y is it that certain amt of space is being left before writing certain code

26th Jun 2018, 4:56 PM
Y AD Ù
Y AD Ù - avatar
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
26th Jun 2018, 5:03 PM
Agent
Agent - avatar
+ 2
Indentation in Python is part of the syntax! Changing the indentation may affect the BEHAVIOUR of your code
26th Jun 2018, 6:45 PM
darrencweid
darrencweid - avatar
0
https://code.sololearn.com/cW61xkZFzS8J/?ref=app typically your code here does not increment x each time because the last line misses indentation :)
26th Jun 2018, 7:00 PM
darrencweid
darrencweid - avatar