A

Admin • 833K Points
Coach

Q. How do you make a method private in Python?

  • (A) Prefix method name with one underscore
  • (B) Prefix method name with two underscores
  • (C) Use `private` keyword
  • (D) Prefix with hash (#)
  • Correct Answer - Option(B)
  • Views: 35
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

Private methods are prefixed with two underscores to enable name mangling.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.