πŸ“Š Problem Solving and Python Programming
Q. Why are local variable names beginning with an underscore discouraged?
  • (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
πŸ’¬ Discuss
βœ… Correct Answer: (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.


Explanation by: Mr. Dubey
as python has no concept of private variables, leading underscores are used to indicate variables that must not be accessed from outside the class.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
425
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
84%
Success Rate