venture of iit bombay vjti alumni this means that local variables can be accessed only inside the function in which they are declaredwhereas global variables can be accessed throughout the program body by all functions when you call functionthe variables declared inside it are brought into scope following is simple example #!/usr/bin/python total this is global variable function definition is here def sumarg arg )add both the parameters and return them total arg arg here total is local variable print "inside the function local total "total return totalnow you can call sum function