0
can some explain indentation and blocks
Also please give some examples
2 Answers
+ 4
indentation is a space at the beginning of a written line. Example:
def greet(name):
print 'Hello ', name
greet('Jack')
You see the space at the begining of print? That's it, and you have to do this in Python, if you want or not. It makes the code easier to read, actually.
+ 1
@Cloud : so its easier to spot out particular functions, you mean .. or just to actually only make it easier to read ? Cause I remember reading it somewhere that indentations are necessary to add in Python and not an "if you want or not thing" ? My question is purely based on the necessity of this. Thanks for replying mane !!