Why does the name of local variables start with an underscore discouraged?
- To identify the variable
- It confuses the interpreter
- It indicates a private variable of a class
- None of these
Answer:
Option c: It indicates a private variable of a class
Since there is no concept of private variables in Python language, the major underscore
is used to denote variables that cannot be accessed from outside the class directly.
0 Comments