Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Why are local variable names beginning with an underscore discouraged?

a) they are used to indicate a private variables of a class
b) they are used to indicate global variables
c) they slow down execution
d) they confuse the interpreter

Answer: a
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.

Join The Discussion