+ 4
Please Explain This!
I Couldn't understand the difference between attributes beginning with single underscore and double underscore and how double underscore is strictly private.
3 Respuestas
+ 4
theres no private or protected things in python....
so to make a apperent scene that any part of the code is protected or private we use single or double underscore...
its like a sign to them who are using the code..
like suppose your mom said do not eat chocolate ..there will be teeth problems...
but its like u can eat it if u dont want to listen to your mom...
alike in python...
its a sign ; a red cross..
**u cross this...you will be responcible for further happenings***
/ ## HOPE YOU GOT IT ##/
+ 1
@Sayan Thanks but I know all this and also that we cannot make outside class not to access the argument/method but what is the difference b/w the two as asked in the question?
- 1
in cpp - java...
theres fixed strict things to make code parts private or protected...