class öznitelik

This commit is contained in:
Mert Gör 🇹🇷 2023-06-17 14:38:17 +03:00
parent 29fa6db897
commit 9b11935e10
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

View 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))