class other 3
This commit is contained in:
parent
7998912b9e
commit
a349412548
1 changed files with 8 additions and 0 deletions
8
python-temel/class.sample.other.3.py
Normal file
8
python-temel/class.sample.other.3.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
class Sample:
|
||||
x = 10
|
||||
def __init__(self, x):
|
||||
self.x = x
|
||||
|
||||
s = Sample(20)
|
||||
print(s.x) # 20
|
||||
print(Sample.x) # 10
|
Loading…
Reference in a new issue