Python Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 60)
60.
How does the locals function differ from globals?
locals returns the local namespace, while globals returns the global namespace.
locals returns the global namespace, while globals returns the local namespace.
Both return the same namespace.
Neither locals nor globals return any namespace.
Answer: Option
Explanation:
The locals function returns the local namespace, while globals returns the global namespace.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.