4 Dec 2020

Intendation in python

 * Most of the programming languages like C, C++, Java use braces { } to define a block of code. But, python uses indentation.

Indentation is a very important concept of Python because without proper indenting the Python code, you will end up seeing intendation error and the code will not get compiled.In simple words intendation is the white space in front of a statement .


Example 

def f(n):
   if n==1:
      return 1
   else:
       return f(n-1)
print f(4)





No comments:

Post a Comment

Operator precedence

           When an expression contains more than one operator, the order of evaluation depends on the order of operations.            The ac...