Pythonda Getter Setter
Python
December 02, 2023
İlk Sınıf Yani class a:pass Sonra İnit class a: def __init__(self,__i):self.__i=__i Getter Methodunu def geti(self):return self.i Sonra Setter Methodu de
İlk Sınıf Yani
class a:pass
Sonra İnit
class a:
def __init__(self,__i):self.__i=__i
Getter Methodunu
def geti(self):return self.i
Sonra Setter Methodu
def seti(self,x):self.i=x
Class Bu Kadardı
Test Edelim
a=a(42)
a.set_b(38)
print(a.get_b())
Kod
Share Your Expertise, Earn Rewards!
Found this insightful? Imagine your knowledge generating income. Contribute your articles to bylge.com and connect with readers while unlocking your earning potential.