What are the rules for a local and global variable in python?
Answer / Rajni Pandey
A global variable is accessible within the function in which it's defined and from outside that function. A local variable, on the other hand, can only be accessed within its own function or nested function. To modify the scope of a variable, use the 'global' keyword for global variables inside functions.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are key features of python?
How is unit test done in python?
Explain me database connection in python flask?
What are the use of sets in python?
Is elif a keyword in python?
In the above project, were you alone or were you in group of developers? If so, how many?
What is a dictionary in python programming?
How to call an external command in python?
What is reuests module will do?
How would you perform unit-testing on your python code?
What does input () do in python?
What does ‘#’ symbol do in python?