kitchen cabinets forum

Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: What is Python Scope Resolution?


Newbie

Status: Offline
Posts: 1
Date:
What is Python Scope Resolution?
Permalink   


Objects within the same scope may have the same name yet perform distinct functions. In such circumstances, Python handles scope resolution automatically. Here are a few examples of similar behaviour: Python Course in Pune

The Python modules'math' and 'cmath' share several functions, such as log10(), acos(), exp(), and so on. To overcome this issue, prefix them with their corresponding module, such as math.exp() and cmath.exp().
Consider the following code: an object temp has been globally initialised to 10 and subsequently to 20 on function call. However, the function call did not update the temp's value worldwide. We can see that Python distinguishes between global and local variables by handling them differently. What exactly are Python namespaces? - Blog



__________________
Python Course in Pune
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.



Create your own FREE Forum
Report Abuse
Powered by ActiveBoard