PooriPadhai Logo Home Courses Online Tool Online Test Study Material Contest Blog

Python Global vs Local Variables Online Test



Instructions:
  • Total number of questions : 10.
  • Time alloted : 10 minutes.
  • Each question carry 1 mark.
  • No Negative marks
  • DO NOT refresh the page.
  • All the best :-)




What You Will Learn in

This Global vs Local Variables Test helps you to Boost your Knowledge in Python Language. In this test, we will cover the topics in the form of questions like

  • The function globals() returns a dictionary of the module namespace, whereas the function locals() returns a dictionary of the current namespace.
  • The global variable is shadowed, if a local variable exists with the same name as the local variable that you want to access.
  • On assigning a value to a variable inside a function, it automatically becomes a local variable.
  • globals() and locals() are said to be return value of the data structure dictionary