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.
Loading...
Related Quiz
- In Scikit-learn, ____ is the method used to train a model using the training data.
- How can you perform element-wise multiplication of two NumPy arrays?
- What would be the best sorting algorithm to use if you are concerned about worst-case time complexity?
- Which keyword allows the creation of a block of code that always runs, regardless of exceptions?
- How would you deploy a Django application to a production environment, considering scalability and security?