R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which access modifier makes attributes private?

  • (A) Using one underscore (_) before the name
  • (B) Using two underscores (__) before the name
  • (C) Using `private` keyword
  • (D) Using `lock` keyword
  • Correct Answer - Option(B)
  • Views: 32
  • Filed under category Python
  • Hashtags:

Explanation by: Ram Sharma

Using `__var` makes a variable name mangled, simulating private access.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.