HomeWorking With Function In the following code, which variables are in the same scope? 4 Comments Facebook Twitter Q. In the following code, which variables are in the same scope?def func1(): a = 1 b = 2def func2(): c = 3 d = 4e = 5Answer =Here a, b, c, d are in same scope i.e. local scope.
Should we mention it as a,b local to func1() and c,d local to func2() ?
ReplyDeleteNo, if you do so then it will become parameter.
DeleteWhat about 'e'
ReplyDeletee is in global scope.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )