更新
This commit is contained in:
18
Python-100-Days/Day01-15/Day08/access.py
Normal file
18
Python-100-Days/Day01-15/Day08/access.py
Normal file
@@ -0,0 +1,18 @@
|
||||
class Test:
|
||||
|
||||
def __init__(self, foo):
|
||||
self.__foo = foo
|
||||
|
||||
def __bar(self):
|
||||
print(self.__foo)
|
||||
print('__bar')
|
||||
|
||||
|
||||
def main():
|
||||
test = Test('hello')
|
||||
test._Test__bar()
|
||||
print(test._Test__foo)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user