class method 1

This commit is contained in:
Mert Gör 🇹🇷 2023-08-03 23:34:21 +03:00
parent f6d3145a2e
commit 375b7cddd1
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,12 @@
class Sample:
def __init__(self): # örnek metodu
self.a = 10
@staticmethod
def bar(): # statik metot
print('bar')
@classmethod # sınıf metodu
def tar(cls):
print('tar')

View File

@ -0,0 +1,9 @@
class Sample:
def __init__(self): # örnek metodu
self.a = 10
@staticmethod
def bar(): # statik metot
print('bar')
@classmethod # sınıf metodu