class method 1
This commit is contained in:
parent
f6d3145a2e
commit
375b7cddd1
12
python-temel/classmethod.py
Normal file
12
python-temel/classmethod.py
Normal 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')
|
||||
|
9
python-temel/classmethod.py~
Normal file
9
python-temel/classmethod.py~
Normal 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
|
Loading…
Reference in New Issue
Block a user