class öznitelik
This commit is contained in:
parent
29fa6db897
commit
9b11935e10
15
python-temel/class.oznitelik.py
Normal file
15
python-temel/class.oznitelik.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
class Sample:
|
||||
pass
|
||||
|
||||
s1 = Sample()
|
||||
s1.x = 10
|
||||
s1.y = 20
|
||||
|
||||
print('x = {}, y = {}'.format(s1.x, s1.y))
|
||||
|
||||
s2 = Sample()
|
||||
s2.a = 30
|
||||
s2.b = 'ali'
|
||||
s2.c = 12.3
|
||||
|
||||
print('a = {}, b = {}, c = {}'.format(s2.a, s2.b, s2.c))
|
Loading…
Reference in New Issue
Block a user