diff --git a/python-temel/classmethod.py b/python-temel/classmethod.py new file mode 100644 index 0000000..efe8ced --- /dev/null +++ b/python-temel/classmethod.py @@ -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') + diff --git a/python-temel/classmethod.py~ b/python-temel/classmethod.py~ new file mode 100644 index 0000000..f07dd5e --- /dev/null +++ b/python-temel/classmethod.py~ @@ -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