In Python, which prefix is conventionally used to denote a private member in a class?

  • __private
  • _private
  • priv
  • private
In Python, a private member in a class is conventionally denoted using a single underscore prefix, like _private. While not enforced by the language, it's a widely followed naming convention to indicate that the member should not be accessed directly from outside the class.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *