sscasc@tumkur local and global variables when we declare variable inside function it becomes local variable and its scope is limited to that function where it is created and it is available in that function and not available outside the function when variable declared outside the functionit is available to all function which are using these variables sometimes local variable and global variable have the same namein this case the function ignores global variable and uses local variable only when the programmer wants to use the global variable inside functionwe can use the keyword global before the variable in the beginning of the function body exampleb= #global variable = def myfunction() = #local variable print("global :",bprint("local :",aglobal #this is global print("global :",cc= #this is local print("local :",cmyfunction(output global local global local recursion recursive function is one that invokes itself or recursive function is function that calls itself in its definition for example the mathematical functionfactorialdefined by factorial(nn*( - )( - )* * * can be programmed as def factorial( )# here should be an integer if = return elsereturn *factorial( - any recursive function can be divided into two parts firstthere must be one or more base casesto solve the simplest casewhich is referred to as the base case or the stopping condition nextrecursive caseshere function is called with different argumentswhich are referred to as recursive call these are values that are handled by "reducingthe problem to "simplerproblem of the same form sp_python programming