A

Admin • 832.27K Points
Coach

Q. How do you define a private variable in Python?

  • (A) Using `private` keyword
  • (B) Using `#private` comment
  • (C) Prefix with one underscore
  • (D) Prefix with two underscores
  • Correct Answer - Option(D)
  • Views: 16
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

Variables prefixed with `__` are considered private in Python.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.