mutable.py
This commit is contained in:
parent
0a5a323d58
commit
318cd0c0ba
11
python-temel/mutable.py
Normal file
11
python-temel/mutable.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
class Sample:
|
||||
def __init__(self):
|
||||
self.a = 10
|
||||
self.b = 20
|
||||
|
||||
s = Sample()
|
||||
print(s.a, s.b) # 10, 20
|
||||
|
||||
s.a = 100
|
||||
s.b = 200
|
||||
print(s.a, s.b) # 100, 200
|
Loading…
Reference in New Issue
Block a user