File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright (C) Deepali Srivastava - All Rights Reserved
2+ # This code is part of Python course available on CourseGalaxy.com
3+
4+ class Product :
5+ def __init__ (self ):
6+ self .data1 = 10
7+ self ._data2 = 20
8+
9+ def methodA (self ):
10+ pass
11+
12+ def _methodB (self ):
13+ pass
14+
15+ p = Product ()
16+
17+ print (p .data1 )
18+ p .methodA ()
19+ print (p ._data2 )
20+ p ._methodB ()
Original file line number Diff line number Diff line change 1+ # Copyright (C) Deepali Srivastava - All Rights Reserved
2+ # This code is part of Python course available on CourseGalaxy.com
3+
4+ class Product :
5+ def __init__ (self ):
6+ self .data1 = 10
7+ self .__data2 = 20
8+
9+ def methodA (self ):
10+ pass
11+
12+ def __methodB (self ):
13+ pass
14+
15+ p = Product ()
16+ #print(p.__data2)
17+ #p.__methodB()
18+ print (p ._Product__data2 )
19+ p ._Product__methodB ()
You can’t perform that action at this time.
0 commit comments