0
How to know Public, Private and Protected ?
inside a python class if we have some functions then how to identify which is Public, Private and Protected ?
3 Answers
+ 2
Variables and methods are public by default in python. In order to make a variable/method protected prefix its name with a single underscore. To make it private prefix it with a double underscore.
+ 1
however, you can never guarantee that your attributes will be protected this way. Use it if you really have the need to do that
0
ok , thanks