Hi. Another newbie question here:
The material I am using (python essentials on openedg) says that:
The scope of a function’s parameter is the function itself. The parameter is inaccessible outside the function. With it showing the below example:
def adding(x):
var = 7
return x + var
print(adding(4)) # outputs: 11
print(var) # outputs NameError
However, when I try it on the platform I am using, which is Anaconda Python, it shows output of 11 and 7. Does it have to do with what platform one is using?
Thanks.