Notifications
Clear all
Topic starter
Question: Why are local variable names beginning with an underscore discouraged?
Options are:
a) they are used to indicate a private variables of a class
b) they confuse the interpreter
c) they are used to indicate global variables
d) they slow down execution
Correct answer is in first reply
Posted : 19/03/2023 2:09 pm
Topic starter
correct option is:
a). they are used to indicate a private variables of a class
Explanation: As Python has no concept of private variables, leading underscores are
used to indicate variables that must not be accessed from outside the class.
Posted : 19/03/2023 2:10 pm