To be honest, I was expecting some sort of error, like 'you can't rename two nested functions with same name in a same body like that' , Can we define any number of functions with same name in python ?
In [40]: def add(i,j):
....: def add(i,j):
....: print i+j
....: def add(i,j):
....: print i-j
....: return add(i,j)
....:
In [41]: add(5,4)
1
Is this Overloading of function, or Overriding of function ??
The overloaded function must differ either by the arity or data types, since there are no types of arguments in function definition.. no overloading,,, look at this stackoverflow.com/questions/733264/…....